@jsonjoy.com/json-type
Version:
High-performance JSON Pointer implementation
20 lines (19 loc) • 828 B
TypeScript
import { Codegen } from '@jsonjoy.com/util/lib/codegen';
import type { TypeSystem } from '../../system';
import type { Type } from '../../type';
export type CompiledCapacityEstimator = (value: any) => number;
export interface CapacityEstimatorCodegenContextOptions {
/** Type for which to generate the encoder. */
type: Type;
/** Type system to use for alias and validator resolution. */
system?: TypeSystem;
/** Name to concatenate to the end of the generated function. */
name?: string;
}
export declare class CapacityEstimatorCodegenContext {
readonly options: CapacityEstimatorCodegenContextOptions;
readonly codegen: Codegen<CompiledCapacityEstimator>;
constructor(options: CapacityEstimatorCodegenContextOptions);
inc(inc: number): void;
compile(): CompiledCapacityEstimator;
}