@univerjs/engine-formula v0.5.0-beta.1 • Docs
Class: BaseFunction
Extended by
Constructors
new BaseFunction()
new BaseFunction(_name): BaseFunction
Parameters
Parameter | Type |
---|---|
_name | IFunctionNames |
Returns
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:91
Properties
Property | Modifier | Type | Default value | Description | Defined in |
---|---|---|---|---|---|
_columnCount | protected | number | -1 | - | submodules/univer/packages/engine-formula/src/functions/base-function.ts:49 |
_formulaDataModel | protected | Nullable <FormulaDataModel > | undefined | - | submodules/univer/packages/engine-formula/src/functions/base-function.ts:47 |
_rowCount | protected | number | -1 | - | submodules/univer/packages/engine-formula/src/functions/base-function.ts:48 |
maxParams | public | number | -1 | Maximum number of parameters | submodules/univer/packages/engine-formula/src/functions/base-function.ts:89 |
minParams | public | number | -1 | Minimum number of parameters | submodules/univer/packages/engine-formula/src/functions/base-function.ts:84 |
needsExpandParams | public | boolean | false | Whether the function needs to expand the parameters | submodules/univer/packages/engine-formula/src/functions/base-function.ts:54 |
needsFormulaDataModel | public | boolean | false | Whether the function needs function methods in FormulaDataModel | submodules/univer/packages/engine-formula/src/functions/base-function.ts:74 |
needsLocale | public | boolean | false | Whether the function needs handle locale | submodules/univer/packages/engine-formula/src/functions/base-function.ts:64 |
needsReferenceObject | public | boolean | false | Whether the function needs to pass in reference object | submodules/univer/packages/engine-formula/src/functions/base-function.ts:59 |
needsSheetRowColumnCount | public | boolean | false | Whether the function needs the number of rows and columns in the sheet | submodules/univer/packages/engine-formula/src/functions/base-function.ts:79 |
needsSheetsInfo | public | boolean | false | Whether the function needs sheets info | submodules/univer/packages/engine-formula/src/functions/base-function.ts:69 |
Accessors
column
Get Signature
get column(): number
Returns
number
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:111
name
Get Signature
get name(): IFunctionNames
Returns
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:95
row
Get Signature
get row(): number
Returns
number
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:107
subUnitId
Get Signature
get subUnitId(): Nullable<string>
Returns
Nullable
<string
>
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:103
unitId
Get Signature
get unitId(): Nullable<string>
Returns
Nullable
<string
>
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:99
Methods
binarySearch()
binarySearch(
value,
searchArray,
resultArray,
searchType?,
matchType?): BaseValueObject
Parameters
Parameter | Type |
---|---|
value | BaseValueObject |
searchArray | ArrayValueObject |
resultArray | ArrayValueObject |
searchType ? | ArrayBinarySearchType |
matchType ? | ArrayOrderSearchType |
Returns
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:315
binarySearchExpand()
binarySearchExpand(
value,
searchArray,
resultArray,
axis,
searchType?,
matchType?): undefined | ErrorValueObject | ArrayValueObject
Parameters
Parameter | Type | Default value |
---|---|---|
value | BaseValueObject | undefined |
searchArray | ArrayValueObject | undefined |
resultArray | ArrayValueObject | undefined |
axis | number | 0 |
searchType ? | ArrayBinarySearchType | undefined |
matchType ? | ArrayOrderSearchType | undefined |
Returns
undefined
| ErrorValueObject
| ArrayValueObject
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:402
calculate()
calculate(...arg): NodeValueType
Parameters
Parameter | Type |
---|---|
…arg | BaseValueObject [] |
Returns
NodeValueType
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:199
calculateCustom()
calculateCustom(...arg): PrimitiveValueType | PrimitiveValueType[][]
Parameters
Parameter | Type |
---|---|
…arg | (PrimitiveValueType | PrimitiveValueType [][])[] |
Returns
PrimitiveValueType
| PrimitiveValueType
[][]
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:193
checkArrayType()
checkArrayType(variant): boolean
Parameters
Parameter | Type |
---|---|
variant | FunctionVariantType |
Returns
boolean
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:203
createReferenceObject()
createReferenceObject(reference, range): ErrorValueObject | BaseReferenceObject
Parameters
Parameter | Type |
---|---|
reference | BaseReferenceObject |
range | IRange |
Returns
ErrorValueObject
| BaseReferenceObject
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:561
dispose()
dispose(): void
Returns
void
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:115
equalSearch()
equalSearch(
value,
searchArray,
resultArray,
isFirst): BaseValueObject
Parameters
Parameter | Type | Default value |
---|---|---|
value | BaseValueObject | undefined |
searchArray | ArrayValueObject | undefined |
resultArray | ArrayValueObject | undefined |
isFirst | boolean | true |
Returns
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:360
equalSearchExpand()
equalSearchExpand(
value,
searchArray,
resultArray,
isFirst,
axis): undefined | ErrorValueObject | ArrayValueObject
Parameters
Parameter | Type | Default value |
---|---|---|
value | BaseValueObject | undefined |
searchArray | ArrayValueObject | undefined |
resultArray | ArrayValueObject | undefined |
isFirst | boolean | true |
axis | number | 0 |
Returns
undefined
| ErrorValueObject
| ArrayValueObject
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:422
flattenArray()
flattenArray(variants, ignoreLogicalValuesAndText): BaseValueObject | ArrayValueObject
Parameters
Parameter | Type | Default value |
---|---|---|
variants | BaseValueObject [] | undefined |
ignoreLogicalValuesAndText | boolean | true |
Returns
BaseValueObject
| ArrayValueObject
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:496
fuzzySearch()
fuzzySearch(
value,
searchArray,
resultArray,
isFirst): BaseValueObject
Parameters
Parameter | Type | Default value |
---|---|---|
value | BaseValueObject | undefined |
searchArray | ArrayValueObject | undefined |
resultArray | ArrayValueObject | undefined |
isFirst | boolean | true |
Returns
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:370
fuzzySearchExpand()
fuzzySearchExpand(
value,
searchArray,
resultArray,
isFirst,
axis): undefined | ErrorValueObject | ArrayValueObject
Parameters
Parameter | Type | Default value |
---|---|---|
value | BaseValueObject | undefined |
searchArray | ArrayValueObject | undefined |
resultArray | ArrayValueObject | undefined |
isFirst | boolean | true |
axis | number | 0 |
Returns
undefined
| ErrorValueObject
| ArrayValueObject
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:449
getDefinedName()
getDefinedName(name): null | IDefinedNamesServiceParam
In Excel, to inject a defined name into a function that has positioning capabilities, such as using the INDIRECT function to reference a named range, you can write it as follows: =INDIRECT(“DefinedName1”)
Parameters
Parameter | Type |
---|---|
name | string |
Returns
null
| IDefinedNamesServiceParam
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:125
getIndexNumValue()
getIndexNumValue(indexNum, defaultValue): number | ErrorValueObject
Starting with 1 For instance, The column number (starting with 1 for the left-most column of table_array) that contains the return value. https://support.microsoft.com/en-us/office/vlookup-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1
Parameters
Parameter | Type | Default value |
---|---|---|
indexNum | BaseValueObject | undefined |
defaultValue | number | 1 |
Returns
number
| ErrorValueObject
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:213
getLocale()
getLocale(): LocaleType
Returns
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:139
getMatchTypeValue()
getMatchTypeValue(logicValueObject?): undefined | number
A logical value that specifies 1/TRUE , 0/FALSE, -1, default 1. The difference from getZeroOrOneByOneDefault is that we need to get -1
Parameters
Parameter | Type |
---|---|
logicValueObject ? | BaseValueObject |
Returns
undefined
| number
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:287
getSheetsInfo()
getSheetsInfo(): {
sheetNameMap: {};
sheetOrder: string[];
}
Returns
{
sheetNameMap: {};
sheetOrder: string[];
}
Name | Type | Defined in |
---|---|---|
sheetNameMap | {} | submodules/univer/packages/engine-formula/src/functions/base-function.ts:150 |
sheetOrder | string [] | submodules/univer/packages/engine-formula/src/functions/base-function.ts:149 |
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:147
getZeroOrOneByOneDefault()
getZeroOrOneByOneDefault(logicValueObject?): undefined | number
A logical value that specifies 1/TRUE , 0/FALSE, default 1 For instance range_lookup, A logical value that specifies whether you want VLOOKUP to find an approximate or an exact match Approximate match - 1/TRUE Exact match - 0/FALSE https://support.microsoft.com/en-us/office/vlookup-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1 For instance A1, A logical value that specifies what type of reference is contained in the cell ref_text. If a1 is TRUE or omitted, ref_text is interpreted as an A1-style reference. If a1 is FALSE, ref_text is interpreted as an R1C1-style reference. https://support.microsoft.com/zh-cn/office/indirect-%E5%87%BD%E6%95%B0-474b3a3a-8a26-4f44-b491-92b6306fa261
Parameters
Parameter | Type |
---|---|
logicValueObject ? | BaseValueObject |
Returns
undefined
| number
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:254
isAddress()
isAddress(): boolean
Returns
boolean
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:178
isAsync()
isAsync(): boolean
Returns
boolean
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:174
isCustom()
isCustom(): boolean
Returns
boolean
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:182
orderSearch()
orderSearch(
value,
searchArray,
resultArray,
searchType,
isDesc): BaseValueObject
Parameters
Parameter | Type | Default value |
---|---|---|
value | BaseValueObject | undefined |
searchArray | ArrayValueObject | undefined |
resultArray | ArrayValueObject | undefined |
searchType | ArrayOrderSearchType | ArrayOrderSearchType.MIN |
isDesc | boolean | false |
Returns
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:380
orderSearchExpand()
orderSearchExpand(
value,
searchArray,
resultArray,
searchType,
isDesc,
axis): undefined | ErrorValueObject | ArrayValueObject
Parameters
Parameter | Type | Default value |
---|---|---|
value | BaseValueObject | undefined |
searchArray | ArrayValueObject | undefined |
resultArray | ArrayValueObject | undefined |
searchType | ArrayOrderSearchType | ArrayOrderSearchType.MIN |
isDesc | boolean | false |
axis | number | 0 |
Returns
undefined
| ErrorValueObject
| ArrayValueObject
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:476
setDefinedNames()
setDefinedNames(definedNames): void
Parameters
Parameter | Type |
---|---|
definedNames | IDefinedNameMapItem |
Returns
void
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:135
setFormulaDataModel()
setFormulaDataModel(_formulaDataModel): void
Parameters
Parameter | Type |
---|---|
_formulaDataModel | FormulaDataModel |
Returns
void
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:165
setLocale()
setLocale(locale): void
Parameters
Parameter | Type |
---|---|
locale | LocaleType |
Returns
void
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:143
setRefInfo()
setRefInfo(
unitId,
subUnitId,
row,
column): void
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
row | number |
column | number |
Returns
void
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:186
setSheetRowColumnCount()
setSheetRowColumnCount(rowCount, columnCount): void
Parameters
Parameter | Type |
---|---|
rowCount | number |
columnCount | number |
Returns
void
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:169
setSheetsInfo()
setSheetsInfo(__namedParameters): void
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.sheetNameMap | object |
__namedParameters.sheetOrder | string [] |
Returns
void
Defined in
submodules/univer/packages/engine-formula/src/functions/base-function.ts:154