@univerjs/engine-formula v0.5.4


Class: BaseFunction

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:39

Extended by

Constructors

new BaseFunction()

new BaseFunction(_name): BaseFunction

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:92

Parameters

ParameterType
_nameIFunctionNames

Returns

BaseFunction

Properties

PropertyModifierTypeDefault valueDescriptionDefined in
_columnCountprotectednumber-1-submodules/univer/packages/engine-formula/src/functions/base-function.ts:50
_formulaDataModelprotectedNullable<FormulaDataModel>undefined-submodules/univer/packages/engine-formula/src/functions/base-function.ts:48
_rowCountprotectednumber-1-submodules/univer/packages/engine-formula/src/functions/base-function.ts:49
maxParamspublicnumber-1Maximum number of parameterssubmodules/univer/packages/engine-formula/src/functions/base-function.ts:90
minParamspublicnumber-1Minimum number of parameterssubmodules/univer/packages/engine-formula/src/functions/base-function.ts:85
needsExpandParamspublicbooleanfalseWhether the function needs to expand the parameterssubmodules/univer/packages/engine-formula/src/functions/base-function.ts:55
needsFormulaDataModelpublicbooleanfalseWhether the function needs function methods in FormulaDataModelsubmodules/univer/packages/engine-formula/src/functions/base-function.ts:75
needsLocalepublicbooleanfalseWhether the function needs handle localesubmodules/univer/packages/engine-formula/src/functions/base-function.ts:65
needsReferenceObjectpublicbooleanfalseWhether the function needs to pass in reference objectsubmodules/univer/packages/engine-formula/src/functions/base-function.ts:60
needsSheetRowColumnCountpublicbooleanfalseWhether the function needs the number of rows and columns in the sheetsubmodules/univer/packages/engine-formula/src/functions/base-function.ts:80
needsSheetsInfopublicbooleanfalseWhether the function needs sheets infosubmodules/univer/packages/engine-formula/src/functions/base-function.ts:70

Accessors

column

Get Signature

get column(): number

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:112

Returns

number


name

Get Signature

get name(): IFunctionNames

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:96

Returns

IFunctionNames


row

Get Signature

get row(): number

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:108

Returns

number


subUnitId

Get Signature

get subUnitId(): Nullable<string>

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:104

Returns

Nullable<string>


unitId

Get Signature

get unitId(): Nullable<string>

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:100

Returns

Nullable<string>

Methods

binarySearch()

binarySearch(
   value, 
   searchArray, 
   resultArray, 
   searchType?, 
   matchType?): BaseValueObject

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:316

Parameters

ParameterType
valueBaseValueObject
searchArrayArrayValueObject
resultArrayArrayValueObject
searchType?ArrayBinarySearchType
matchType?ArrayOrderSearchType

Returns

BaseValueObject


binarySearchExpand()

binarySearchExpand(
   value, 
   searchArray, 
   resultArray, 
   axis, 
   searchType?, 
   matchType?): 
  | undefined
  | ErrorValueObject
  | ArrayValueObject

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:403

Parameters

ParameterTypeDefault value
valueBaseValueObjectundefined
searchArrayArrayValueObjectundefined
resultArrayArrayValueObjectundefined
axisnumber0
searchType?ArrayBinarySearchTypeundefined
matchType?ArrayOrderSearchTypeundefined

Returns

| undefined | ErrorValueObject | ArrayValueObject


calculate()

calculate(...arg): NodeValueType

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:200

Parameters

ParameterType
argBaseValueObject[]

Returns

NodeValueType


calculateCustom()

calculateCustom(...arg): 
  | FormulaFunctionResultValueType
| Promise<FormulaFunctionResultValueType>

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:194

Parameters

ParameterType
argFormulaFunctionValueType[]

Returns

| FormulaFunctionResultValueType | Promise<FormulaFunctionResultValueType>


checkArrayType()

checkArrayType(variant): boolean

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:204

Parameters

ParameterType
variantFunctionVariantType

Returns

boolean


createReferenceObject()

createReferenceObject(reference, range): 
  | ErrorValueObject
  | BaseReferenceObject

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:562

Parameters

ParameterType
referenceBaseReferenceObject
rangeIRange

Returns

| ErrorValueObject | BaseReferenceObject


dispose()

dispose(): void

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:116

Returns

void


equalSearch()

equalSearch(
   value, 
   searchArray, 
   resultArray, 
   isFirst): BaseValueObject

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:361

Parameters

ParameterTypeDefault value
valueBaseValueObjectundefined
searchArrayArrayValueObjectundefined
resultArrayArrayValueObjectundefined
isFirstbooleantrue

Returns

BaseValueObject


equalSearchExpand()

equalSearchExpand(
   value, 
   searchArray, 
   resultArray, 
   isFirst, 
   axis): 
  | undefined
  | ErrorValueObject
  | ArrayValueObject

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:423

Parameters

ParameterTypeDefault value
valueBaseValueObjectundefined
searchArrayArrayValueObjectundefined
resultArrayArrayValueObjectundefined
isFirstbooleantrue
axisnumber0

Returns

| undefined | ErrorValueObject | ArrayValueObject


flattenArray()

flattenArray(variants, ignoreLogicalValuesAndText): 
  | BaseValueObject
  | ArrayValueObject

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:497

Parameters

ParameterTypeDefault value
variantsBaseValueObject[]undefined
ignoreLogicalValuesAndTextbooleantrue

Returns

| BaseValueObject | ArrayValueObject


fuzzySearch()

fuzzySearch(
   value, 
   searchArray, 
   resultArray, 
   isFirst): BaseValueObject

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:371

Parameters

ParameterTypeDefault value
valueBaseValueObjectundefined
searchArrayArrayValueObjectundefined
resultArrayArrayValueObjectundefined
isFirstbooleantrue

Returns

BaseValueObject


fuzzySearchExpand()

fuzzySearchExpand(
   value, 
   searchArray, 
   resultArray, 
   isFirst, 
   axis): 
  | undefined
  | ErrorValueObject
  | ArrayValueObject

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:450

Parameters

ParameterTypeDefault value
valueBaseValueObjectundefined
searchArrayArrayValueObjectundefined
resultArrayArrayValueObjectundefined
isFirstbooleantrue
axisnumber0

Returns

| undefined | ErrorValueObject | ArrayValueObject


getDefinedName()

getDefinedName(name): 
  | null
  | IDefinedNamesServiceParam

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:126

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

ParameterType
namestring

Returns

| null | IDefinedNamesServiceParam


getIndexNumValue()

getIndexNumValue(indexNum, defaultValue): number | ErrorValueObject

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:214

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

ParameterTypeDefault value
indexNumBaseValueObjectundefined
defaultValuenumber1

Returns

number | ErrorValueObject


getLocale()

getLocale(): LocaleType

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:140

Returns

LocaleType


getMatchTypeValue()

getMatchTypeValue(logicValueObject?): undefined | number

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:288

A logical value that specifies 1/TRUE , 0/FALSE, -1, default 1. The difference from getZeroOrOneByOneDefault is that we need to get -1

Parameters

ParameterType
logicValueObject?BaseValueObject

Returns

undefined | number


getSheetsInfo()

getSheetsInfo(): {
  sheetNameMap: {};
  sheetOrder: string[];
}

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:148

Returns

{
  sheetNameMap: {};
  sheetOrder: string[];
}
NameTypeDefined in
sheetNameMap{}submodules/univer/packages/engine-formula/src/functions/base-function.ts:151
sheetOrderstring[]submodules/univer/packages/engine-formula/src/functions/base-function.ts:150

getZeroOrOneByOneDefault()

getZeroOrOneByOneDefault(logicValueObject?): undefined | number

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:255

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

ParameterType
logicValueObject?BaseValueObject

Returns

undefined | number


isAddress()

isAddress(): boolean

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:179

Returns

boolean


isAsync()

isAsync(): boolean

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:175

Returns

boolean


isCustom()

isCustom(): boolean

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:183

Returns

boolean


orderSearch()

orderSearch(
   value, 
   searchArray, 
   resultArray, 
   searchType, 
   isDesc): BaseValueObject

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:381

Parameters

ParameterTypeDefault value
valueBaseValueObjectundefined
searchArrayArrayValueObjectundefined
resultArrayArrayValueObjectundefined
searchTypeArrayOrderSearchTypeArrayOrderSearchType.MIN
isDescbooleanfalse

Returns

BaseValueObject


orderSearchExpand()

orderSearchExpand(
   value, 
   searchArray, 
   resultArray, 
   searchType, 
   isDesc, 
   axis): 
  | undefined
  | ErrorValueObject
  | ArrayValueObject

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:477

Parameters

ParameterTypeDefault value
valueBaseValueObjectundefined
searchArrayArrayValueObjectundefined
resultArrayArrayValueObjectundefined
searchTypeArrayOrderSearchTypeArrayOrderSearchType.MIN
isDescbooleanfalse
axisnumber0

Returns

| undefined | ErrorValueObject | ArrayValueObject


setDefinedNames()

setDefinedNames(definedNames): void

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:136

Parameters

ParameterType
definedNamesIDefinedNameMapItem

Returns

void


setFormulaDataModel()

setFormulaDataModel(_formulaDataModel): void

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:166

Parameters

ParameterType
_formulaDataModelFormulaDataModel

Returns

void


setLocale()

setLocale(locale): void

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:144

Parameters

ParameterType
localeLocaleType

Returns

void


setRefInfo()

setRefInfo(
   unitId, 
   subUnitId, 
   row, 
   column): void

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:187

Parameters

ParameterType
unitIdstring
subUnitIdstring
rownumber
columnnumber

Returns

void


setSheetRowColumnCount()

setSheetRowColumnCount(rowCount, columnCount): void

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:170

Parameters

ParameterType
rowCountnumber
columnCountnumber

Returns

void


setSheetsInfo()

setSheetsInfo(__namedParameters): void

Defined in: submodules/univer/packages/engine-formula/src/functions/base-function.ts:155

Parameters

ParameterType
__namedParameters{ sheetNameMap: {}; sheetOrder: string[]; }
__namedParameters.sheetNameMap{}
__namedParameters.sheetOrderstring[]

Returns

void