UNPKG

krl-stdlib

Version:
44 lines (43 loc) 2.41 kB
/** * This krl module is all the core utilities for working with the KRL language at runtime */ import * as SelectWhenModule from "select-when"; import { aggregateEvent as aggregateEventFn } from "./aggregateEvent"; import { KrlCtx } from "./KrlCtx"; export declare const SelectWhen: typeof SelectWhenModule; export declare const aggregateEvent: typeof aggregateEventFn; export interface Module { [name: string]: (ctx: KrlCtx, args?: any) => any; } export declare const Function: (paramOrder: string[], fn: (this: KrlCtx, ...args: any[]) => any) => (ctx: KrlCtx, args: any) => any; export declare const Action: (paramOrder: string[], fn: (this: KrlCtx, ...args: any[]) => any) => (ctx: KrlCtx, args: any) => any; export declare const Postlude: (paramOrder: string[], fn: (this: KrlCtx, ...args: any[]) => any) => (ctx: KrlCtx, args: any) => any; export declare function ActionFunction(paramOrder: string[], fn: (this: KrlCtx, ...args: any[]) => any): (ctx: KrlCtx, args: any) => any; export declare function Property(fn: (this: KrlCtx) => any): (ctx: KrlCtx) => any; /** * used by `foreach` in krl * Array's use index numbers, maps use key strings */ export declare function toPairs(v: any): any[][]; export declare function isNull(val: any): boolean; export declare function isNumber(val: any): boolean; export declare function isString(val: any): boolean; export declare function isHex(val: any): boolean; export declare function isBoolean(val: any): boolean; export declare function isRegExp(val: any): boolean; export declare function isArray(val: any): boolean; export declare function isMap(val: any): boolean; export declare function isArrayOrMap(val: any): boolean; export declare function isFunction(val: any): boolean; export declare function assertFunction(val: any): any; export declare function isAction(val: any): boolean; export declare function assertAction(val: any): any; export declare function isPostlude(val: any): boolean; export declare function typeOf(val: any): string; export declare function toString(val: any): string; export declare function toNumberOrNull(val: any): number | null; export declare function toHexOrNull(val: any): string | null; export declare function isEqual(left: any, right: any): boolean; export declare function cleanNulls(val: any): any; export declare function decode(val: any): any; export declare function encode(val: any, indent?: any): string;