@uboness/homebridge-unifi-access
Version:
Homebridge Unifi Access Plugin
27 lines • 1.24 kB
TypeScript
export type Detachable = {
detach: () => void;
};
export type Nil = null | undefined;
export type Promisable<T = void> = T | Promise<T>;
export type ValueCallback<V, R = void> = (value: V) => Promisable<R>;
export declare const isNil: (value: any) => value is Nil;
export declare const isUndefined: (value: any) => value is undefined;
export declare const isString: (value: any) => value is string;
export declare const isBoolean: (value: any) => value is boolean;
export declare const isNumber: (value: any) => value is number;
export type JSON = JSONPrimitive | JSONObject | JSONArray;
export type JSONPrimitive = string | number | boolean | null;
export type JSONArray = JSON[];
export type JSONObject = {
[key: string]: JSON;
};
export declare const cleanArrayAsync: <T = any>(array: T[], cb: (value: T) => void | Promise<void>) => Promise<void>;
export declare const spliceFirstMatch: <T = any>(array: T[], predicate: (value: T) => boolean) => T | undefined;
export declare class Detachables implements Detachable {
private detachables;
constructor(detachables?: Detachable[]);
add(detachable: Detachable): Detachable;
remove(detachable: Detachable): void;
detach(): void;
}
//# sourceMappingURL=common.d.ts.map