@jsonjoy.com/json-type
Version:
High-performance JSON Pointer implementation
27 lines (26 loc) • 1.75 kB
TypeScript
import { Codegen } from '@jsonjoy.com/codegen';
import { JsExpression } from '@jsonjoy.com/codegen/lib/util/JsExpression';
import { BoolType, ConType, NumType } from '../../type';
import type { AnyType, ArrType, BinType, MapType, KeyType, ObjType, OrType, RefType, StrType, Type } from '../../type';
import { AbstractCodegen } from '../AbstractCodege';
import type { SchemaPath } from '../types';
export type CompiledCapacityEstimator = (value: unknown) => number;
export declare class CapacityEstimatorCodegen extends AbstractCodegen<CompiledCapacityEstimator> {
readonly type: Type;
static readonly get: (this: unknown, type: Type, name?: string | undefined) => CompiledCapacityEstimator;
readonly codegen: Codegen<CompiledCapacityEstimator>;
constructor(type: Type, name?: string);
private inc;
protected onAny(path: SchemaPath, r: JsExpression, type: AnyType): void;
protected onCon(path: SchemaPath, r: JsExpression, type: ConType): void;
protected onBool(path: SchemaPath, r: JsExpression, type: BoolType): void;
protected onNum(path: SchemaPath, r: JsExpression, type: NumType): void;
protected onStr(path: SchemaPath, r: JsExpression, type: StrType): void;
protected onBin(path: SchemaPath, r: JsExpression, type: BinType): void;
protected onArr(path: SchemaPath, r: JsExpression, type: ArrType): void;
protected onObj(path: SchemaPath, r: JsExpression, type: ObjType): void;
protected onKey(path: SchemaPath, r: JsExpression, type: KeyType<any, any>): void;
protected onMap(path: SchemaPath, r: JsExpression, type: MapType): void;
protected onRef(path: SchemaPath, r: JsExpression, type: RefType): void;
protected onOr(path: SchemaPath, r: JsExpression, type: OrType): void;
}