UNPKG

flagpole

Version:

Simple and fast DOM integration, headless or headful browser, and REST API testing framework.

55 lines (54 loc) 3.91 kB
import { IteratorBoolCallback, IteratorCallback } from "./interfaces/iterator-callbacks"; import { Schema, ValidateFunction } from "ajv"; import { AssertSchemaType } from "./interfaces/schema"; import { iMessageAndCallback } from "./interfaces/imessage-and-callback"; export declare const toArray: <T>(value: any) => T[]; export declare const toJson: <T>(json: string) => T; export declare const isNullOrUndefined: (obj: unknown) => boolean; export declare const isAsyncCallback: (func: Function) => boolean; export declare const toOrdinal: (n: number) => string; export declare const toType: (obj: any) => string; export declare const arrayUnique: <T>(arr: T[]) => T[]; export declare const uniqueId: () => string; export declare const openInBrowser: (content: string) => Promise<string>; export declare const runAsync: (callback: Function, delay?: number) => void; export declare const asyncFindIndex: (array: any[], callback: IteratorBoolCallback) => Promise<number>; export declare const asyncFind: <T>(array: T[], callback: IteratorBoolCallback) => Promise<T | null>; export declare const asyncFindNot: <T>(array: T[], callback: IteratorBoolCallback) => Promise<T | null>; export declare const asyncUntil: <T>(array: any[], callback: IteratorCallback) => Promise<T | null>; export declare const asyncForEach: <T>(array: T[], callback: IteratorCallback) => Promise<void>; export declare const asyncEvery: <T>(array: T[], callback: IteratorBoolCallback) => Promise<boolean>; export declare const asyncFilter: <T>(array: T[], callback: IteratorBoolCallback) => Promise<T[]>; export declare const asyncMap: <T, F = unknown>(array: F[], callback: IteratorCallback) => Promise<T[]>; export declare const asyncFlatMap: <T, F = unknown>(array: F[], callback: IteratorCallback) => Promise<T[]>; export declare const asyncMapToObject: <T>(array: string[], callback: IteratorCallback) => Promise<{ [key: string]: T; }>; export declare function asyncNone<T>(array: T[], callback: IteratorBoolCallback): Promise<boolean>; export declare function asyncSome<T>(array: T[], callback: IteratorBoolCallback): Promise<boolean>; export declare function asyncCount<T>(array: T[], callback: IteratorBoolCallback): Promise<number>; export declare const flatten: <T>(items: any[] | { [key: string]: any; }) => T[]; export declare const arrayEquals: (a: any, b: any) => boolean; export declare const arrayExactly: (a: any, b: any) => boolean; export declare function normalizePath(uri: string): string; export declare function ensureFolderExists(path: string): void; export declare function emptyFolder(folderPath: string): Promise<void>; export declare function exitProcess(passed: boolean): void; export declare function getMessageAndCallbackFromOverloading(a: any, b: any, defaultMessage?: string): iMessageAndCallback; export declare const deepEqual: (thisValue: any, thatValue: any) => boolean; export declare const deepStrictEqual: (thisValue: any, thatValue: any) => boolean; export declare const objectContains: (thisValue: any, thatValue: any) => boolean; export declare const objectContainsKeys: (thisValue: any, keys: any) => boolean; export declare const nthIn: <T>(obj: unknown, index: number) => T | null; export declare const firstIn: <T>(obj: any) => T | null; export declare const middleIn: <T>(obj: any) => T | null; export declare const lastIn: <T>(obj: any) => T | null; export declare const random: (min: number, max: number) => number; export declare const randomInt: (min: number, max: number) => number; export declare const randomIn: <T>(obj: any) => T | null; export declare const cast: <T>(val: any) => T; export declare const loadSchemaValidator: (schemaType: AssertSchemaType, schema: Schema) => ValidateFunction; export declare const validateSchema: (thisValue: any, schema: Schema, schemaType: AssertSchemaType) => string[]; export declare const getFunctionArgs: (func: Function) => string[];