@whisklabs/grpc
Version:
gRPC generator and http library for typescript
30 lines (29 loc) • 1 kB
TypeScript
import { Option, Options } from './types';
export declare const cut: <T>(arr: T[], count: number) => T[];
export declare const cutStr: (str?: string) => string;
type Validator = string | ((item?: string) => boolean);
type CheckConfig = {
strict?: boolean;
ignore?: boolean;
result?: boolean;
};
export declare const ch: (rule: Validator | Validator[], config?: CheckConfig) => {
rule: Validator | Validator[];
config: CheckConfig | undefined;
};
type Checks = ReturnType<typeof ch>;
type Config = {
type?: string;
rules: Checks[];
tokens: Tokens;
};
export type Tokens = (string | undefined)[];
export declare function check({ type, rules, tokens }: Config): {
errors: [string, number][];
results: string[];
range: Tokens;
len: number;
};
export declare const semicolon: (tokens: string[]) => void;
export declare function insertOption(result: Options, field: string | undefined, out: string | boolean | Options | Option[] | undefined): void;
export {};