@drincs/pixi-vn-ink
Version:
Pixi'VN gives you the ability to write your own narrative using Ink
21 lines (18 loc) • 1.46 kB
text/typescript
/**
* https://github.com/inkle/ink/blob/master/Documentation/ink_JSON_runtime_format.md#native-functions
*
* These are mathematical and logical functions that pop 1 or 2 arguments from the evaluation stack, evaluate the result, and push the result back onto the evaluation stack. The following operators are supported:
*
* "+", "-", "/", "*", "%" (mod), "_" (unary negate), "==", ">", "<", ">=", "<=", "!=", "!" (unary 'not'), "&&", "||", "MIN", "MAX"
*
* Booleans are supported only in the C-style - i.e. as integers where non-zero is treated as "true" and zero as "false". The true result of a boolean operation is pushed to the evaluation stack as 1.
*/
type NativeFunctions = "+" | "-" | "/" | "*" | "%" | "_" | "==" | ">" | "<" | ">=" | "<=" | "!=" | "!" | "&&" | "||" | "MIN" | "MAX";
declare const nativeFunctions: NativeFunctions[];
type ArithmeticFunctions = "+" | "-" | "/" | "*" | "%" | "POW" | "RANDOM";
declare const arithmeticFunctions: ArithmeticFunctions[];
type ArithmeticFunctionsSingle = "INT" | "FLOOR" | "FLOAT";
declare const arithmeticFunctionsSingle: ArithmeticFunctionsSingle[];
type ConditionFunctions = "==" | ">" | "<" | ">=" | "<=" | "!=" | "CONTAINS";
declare const conditionFunctions: ConditionFunctions[];
export { type ArithmeticFunctions, type ArithmeticFunctionsSingle, type ConditionFunctions, arithmeticFunctions, arithmeticFunctionsSingle, conditionFunctions, type NativeFunctions as default, nativeFunctions };