@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
40 lines (39 loc) • 2.21 kB
TypeScript
import { VelcronAppDefinition, VelcronDefinition, VelcronRenderContext, DeferredPromise } from "../models";
export interface ParseResult<T> {
is: boolean;
value: T;
}
export declare class VelcronData {
static dataBind(renderContext: VelcronRenderContext, text: string): string;
static addCtxToVariableNames(template: string, skipIfNameStartsWith?: string, skipIfNameMatches?: Array<string>, overridePrefixWhenNameMatches?: {
[name: string]: string;
}): string;
static evauluateJs(template: string, renderContext: VelcronRenderContext, overrideNamesMatching?: {}): any;
private static variables;
static deleteVariables(id: string): void;
static getVariable<T>(name: string, renderContext: VelcronRenderContext): ParseResult<T>;
static setVariables(eventId: string, varsToSet: object): void;
static evaluateSet(path: string, value: any, renderContext: VelcronRenderContext): void;
static evaluateArray(template: string, renderContext: VelcronRenderContext): Array<any> | null;
static evaluateBoolean(template: string | Boolean, renderContext: VelcronRenderContext): boolean | null;
static tryParseBoolean(bool: any): ParseResult<boolean | null>;
static isString(text: any): boolean;
static isBoolean(value: any): boolean;
static isNumber(value: any): boolean;
static isUndefined(value: any): boolean;
static isArray(obj: any): obj is ExtendArray;
static isObject(value: any): boolean;
static extendObject(obj: any): any;
static getOrSetObjectByPath<T>(object: Object, path: string, value?: any): T | null;
static getOrSetObjectByPathUsingRenderContext<T>(renderContext: VelcronRenderContext, path: string, value?: any): T;
static getTokens(template: any, removeBrackets: boolean): string[];
static ensureEventId(event: string): string;
static ensureKeys(ui: VelcronDefinition | VelcronAppDefinition, generateNewKeys?: boolean): void;
static removeKeys(ui: VelcronDefinition | VelcronAppDefinition): void;
static generateId(): string;
static createDeferredPromise<T>(): DeferredPromise<T>;
}
interface ExtendArray extends Array<any> {
take: (amount: number) => Array<any>;
}
export {};