Archived
1
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
api-ts-gen/dist/utils/StrictTypeParser.d.ts
supmiku39 87615616d6 fix Partial constructor, enhance error msg
add more info to BadValueError
  special message on undefined and null
  trace the location where the error is thrown
add int32 STP
fix STP null argument bug
2020-04-08 20:17:57 +09:00

25 lines
1.1 KiB
TypeScript

import { FullDate } from './FullDate';
export declare module StrictTypeParser {
class BadValueError extends Error {
label: string;
constructor(label: string, message: string);
}
class BadTypeError extends BadValueError {
label: string;
type: string;
value: any;
constructor(label: string, type: string, value: any);
}
function _int32(x: any, label: string): number;
function _number(x: any, label: string): number;
function _string(x: any, label: string): string;
function _boolean(x: any, label: string): boolean;
function _Date(x: any, label: string): Date;
function _FullDate(x: any, label: string): FullDate;
function _byte(x: any, label: string): string;
function _binary(x: any, label: string): string;
function _Array<T>(x: any, label: string, mapper: (x: any) => T): Array<T>;
function parse<T>(stp: (val: any, label: string) => T, val: any, label: string): T;
function nullableParse<T>(stp: (val: any, label: string) => T, val: any, label: string): T | null;
const supportTypes: string[];
}