UNPKG

subflow

Version:

Safety your data flow in TypeScript with flow-based primitives.

29 lines (28 loc) 990 B
import { FlowType } from '../types/meta'; export declare const FLOW_TYPE: unique symbol; export type FLOW_TYPE = typeof FLOW_TYPE; export declare const VALUE: unique symbol; export type VALUE = typeof VALUE; export declare const CUSTOM_METHODS: unique symbol; export type CUSTOM_METHODS = typeof CUSTOM_METHODS; export declare const isFlowOfType: <T extends FlowType>(flow: unknown, type: T) => flow is { [FLOW_TYPE]: T; }; export declare const isStringFlow: (flow: unknown) => flow is { [FLOW_TYPE]: "string"; }; export declare const isNumberFlow: (flow: unknown) => flow is { [FLOW_TYPE]: "number"; }; export declare const isBooleanFlow: (flow: unknown) => flow is { [FLOW_TYPE]: "boolean"; }; export declare const isArrayFlow: (flow: unknown) => flow is { [FLOW_TYPE]: "array"; }; export declare const isObjectFlow: (flow: unknown) => flow is { [FLOW_TYPE]: "object"; }; export declare const isErrorFlow: (flow: unknown) => flow is { [FLOW_TYPE]: "error"; };