UNPKG

@voiceflow/common

Version:

Junk drawer of utility functions

18 lines 1.1 kB
import type { AsyncActionCreators, Meta } from 'typescript-fsa'; export interface AsyncError<C extends number = never> { message: string; code?: C; } export declare const createAction: import("typescript-fsa").ActionCreatorFactory; export declare const createAsyncAction: <P, R, E extends AsyncError<number> = AsyncError<never>>(type: string, commonMeta?: Meta) => AsyncActionCreators<P, R, E>; export declare const typeFactory: (...parts: string[]) => (name: string) => string; export declare class Channel<K extends string> { variables: K[]; build: (params: Record<K, string>) => string; constructor(variables: K[], build: (params: Record<K, string>) => string); buildMatcher(): string; extend<L extends string>(variables: L[], build: (params: Record<L, string>) => string): Channel<K | L>; } export type ChannelParams<T extends Channel<string>> = T extends Channel<infer R> ? Record<R, string> : never; export declare const createChannel: <K extends string>(variables: K[], build: (params: Record<K, string>) => string) => Channel<K>; //# sourceMappingURL=protocol.d.ts.map