@actual-app/api 26.2.0-nightly.20260119 → 26.2.0-nightly.20260120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,4 +3,11 @@ import { type InterpreterState } from 'hyperformula/typings/interpreter/Interpre
|
|
|
3
3
|
import { type ProcedureAst } from 'hyperformula/typings/parser';
|
|
4
4
|
export declare class CustomFunctionsPlugin extends FunctionPlugin {
|
|
5
5
|
integerToAmount(ast: ProcedureAst, state: InterpreterState): import("hyperformula/typings/interpreter/InterpreterValue").RawInterpreterValue;
|
|
6
|
+
fixed(ast: ProcedureAst, state: InterpreterState): import("hyperformula/typings/interpreter/InterpreterValue").RawInterpreterValue;
|
|
6
7
|
}
|
|
8
|
+
export declare const customFunctionsTranslations: {
|
|
9
|
+
enUS: {
|
|
10
|
+
INTEGER_TO_AMOUNT: string;
|
|
11
|
+
FIXED: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
package/dist/app/bundle.api.js
CHANGED
|
@@ -92948,7 +92948,7 @@ function getFullConfigFromPartial(partialConfig) {
|
|
|
92948
92948
|
function getDefaultConfig() {
|
|
92949
92949
|
return getFullConfigFromPartial({});
|
|
92950
92950
|
}
|
|
92951
|
-
const dictionary = {
|
|
92951
|
+
const dictionary$1 = {
|
|
92952
92952
|
errors: {
|
|
92953
92953
|
CYCLE: "#CYCLE!",
|
|
92954
92954
|
DIV_BY_ZERO: "#DIV/0!",
|
|
@@ -102699,19 +102699,27 @@ HyperFormulaNS.SourceLocationHasArrayError = SourceLocationHasArrayError;
|
|
|
102699
102699
|
HyperFormulaNS.TargetLocationHasArrayError = TargetLocationHasArrayError;
|
|
102700
102700
|
HyperFormulaNS.UnableToParseError = UnableToParseError;
|
|
102701
102701
|
const defaultLanguage = Config.defaultConfig.language;
|
|
102702
|
-
HyperFormula.registerLanguage(defaultLanguage, dictionary);
|
|
102703
|
-
HyperFormula.languages[dictionary.langCode] = dictionary;
|
|
102702
|
+
HyperFormula.registerLanguage(defaultLanguage, dictionary$1);
|
|
102703
|
+
HyperFormula.languages[dictionary$1.langCode] = dictionary$1;
|
|
102704
102704
|
for (const pluginName of Object.getOwnPropertyNames(plugins)) {
|
|
102705
102705
|
if (!pluginName.startsWith("_")) {
|
|
102706
102706
|
HyperFormula.registerFunctionPlugin(plugins[pluginName]);
|
|
102707
102707
|
}
|
|
102708
102708
|
}
|
|
102709
|
+
const dictionary = Object.assign(Object.assign({}, dictionary$1), {
|
|
102710
|
+
langCode: "enUS"
|
|
102711
|
+
});
|
|
102709
102712
|
class CustomFunctionsPlugin extends FunctionPlugin {
|
|
102710
102713
|
integerToAmount(ast, state) {
|
|
102711
102714
|
return this.runFunction(ast.args, state, this.metadata("INTEGER_TO_AMOUNT"), (integerAmount, decimalPlaces = 2) => {
|
|
102712
102715
|
return integerToAmount(integerAmount, decimalPlaces);
|
|
102713
102716
|
});
|
|
102714
102717
|
}
|
|
102718
|
+
fixed(ast, state) {
|
|
102719
|
+
return this.runFunction(ast.args, state, this.metadata("FIXED"), (number2, decimals = 0) => {
|
|
102720
|
+
return Number(number2).toFixed(decimals);
|
|
102721
|
+
});
|
|
102722
|
+
}
|
|
102715
102723
|
}
|
|
102716
102724
|
CustomFunctionsPlugin.implementedFunctions = {
|
|
102717
102725
|
INTEGER_TO_AMOUNT: {
|
|
@@ -102724,6 +102732,23 @@ CustomFunctionsPlugin.implementedFunctions = {
|
|
|
102724
102732
|
defaultValue: 2
|
|
102725
102733
|
}
|
|
102726
102734
|
]
|
|
102735
|
+
},
|
|
102736
|
+
FIXED: {
|
|
102737
|
+
method: "fixed",
|
|
102738
|
+
parameters: [
|
|
102739
|
+
{ argumentType: FunctionArgumentType.NUMBER },
|
|
102740
|
+
{
|
|
102741
|
+
argumentType: FunctionArgumentType.NUMBER,
|
|
102742
|
+
optionalArg: true,
|
|
102743
|
+
defaultValue: 0
|
|
102744
|
+
}
|
|
102745
|
+
]
|
|
102746
|
+
}
|
|
102747
|
+
};
|
|
102748
|
+
const customFunctionsTranslations = {
|
|
102749
|
+
enUS: {
|
|
102750
|
+
INTEGER_TO_AMOUNT: "INTEGER_TO_AMOUNT",
|
|
102751
|
+
FIXED: "FIXED"
|
|
102727
102752
|
}
|
|
102728
102753
|
};
|
|
102729
102754
|
function getStatus(nextDate, completed, hasTrans, upcomingLength = "7") {
|
|
@@ -106714,6 +106739,8 @@ function parseBetweenAmount(between) {
|
|
|
106714
106739
|
}
|
|
106715
106740
|
return { type: "between", num1, num2 };
|
|
106716
106741
|
}
|
|
106742
|
+
HyperFormula.registerLanguage("enUS", dictionary);
|
|
106743
|
+
HyperFormula.registerFunctionPlugin(CustomFunctionsPlugin, customFunctionsTranslations);
|
|
106717
106744
|
const ACTION_OPS = [
|
|
106718
106745
|
"set",
|
|
106719
106746
|
"set-split-amount",
|
|
@@ -106899,9 +106926,9 @@ class Action {
|
|
|
106899
106926
|
throw new Error("Formula must start with =");
|
|
106900
106927
|
}
|
|
106901
106928
|
try {
|
|
106902
|
-
HyperFormula.registerFunctionPlugin(CustomFunctionsPlugin);
|
|
106903
106929
|
hfInstance = HyperFormula.buildEmpty({
|
|
106904
|
-
licenseKey: "gpl-v3"
|
|
106930
|
+
licenseKey: "gpl-v3",
|
|
106931
|
+
language: "enUS"
|
|
106905
106932
|
});
|
|
106906
106933
|
const sheetName = hfInstance.addSheet("Sheet1");
|
|
106907
106934
|
const sheetId = hfInstance.getSheetId(sheetName);
|
package/dist/package.json
CHANGED