camstreamerlib
Version:
Helper library for CamStreamer ACAP applications.
26 lines (25 loc) • 963 B
TypeScript
/// <reference types="node" />
/// <reference types="node" />
type Options = {
ip?: string;
port?: number;
user?: string;
pass?: string;
tls?: boolean;
tlsInsecure?: boolean;
};
export type HttpOptions = Options & {
keepAlive?: boolean;
};
export type WsOptions = Options;
export type TGetFunction = (url: string, parameters?: Record<string, string>, headers?: Record<string, string>) => Promise<Response>;
export type TPostFunction = (url: string, data: string | Buffer | FormData, parameters?: Record<string, string>, headers?: Record<string, string>) => Promise<Response>;
export interface IClient {
get: TGetFunction;
post: TPostFunction;
}
export declare function isClient(arg?: Options | IClient): arg is IClient;
export declare function isBrowserEnvironment(): boolean;
export declare function responseStringify(res: Response): Promise<string>;
export declare function pad(num: number, size: number): string;
export {};