@flipt-io/flipt-client-js
Version:
Flipt Client Evaluation SDK for Web and Node.js
32 lines (31 loc) • 1.16 kB
TypeScript
import { BaseFliptClient } from '../core/base';
import { ClientOptions } from '../core/types';
export * from '../core/types';
export * from '../core/base';
export interface WasmOptions {
/**
* The WASM module to use for evaluation.
* Can be provided as:
* - A URL string pointing to the WASM file
* - A filesystem path to the WASM file (in Node.js environments)
* - An ArrayBuffer or Uint8Array containing the WASM binary
* - A WebAssembly.Module object
*
* The simplest way to provide the WASM module is to import it directly from the package:
* ```
* import wasm from '@flipt-io/flipt-client-js/flipt.wasm';
*
* const client = await FliptClient.init({ ... }, { wasm });
* ```
*/
wasm: ArrayBuffer | Uint8Array | WebAssembly.Module | string;
}
export declare class FliptClient extends BaseFliptClient {
/**
* Initialize the client
* @param options - optional client options
* @param wasmOptions - options for loading WASM
* @returns {Promise<FliptClient>}
*/
static init(options?: ClientOptions, wasmOptions?: WasmOptions): Promise<FliptClient>;
}