UNPKG

@jsonjoy.com/json-type

Version:

High-performance JSON Pointer implementation

23 lines (22 loc) 1.9 kB
import type { JsonEncoderCodegenContext } from './JsonEncoderCodegenContext'; import { JsExpression } from '@jsonjoy.com/util/lib/codegen/util/JsExpression'; import type { Type } from '../../type'; type JsonEncoderFunction = (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type) => void; export declare const any: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type) => void; export declare const bool: (ctx: JsonEncoderCodegenContext, value: JsExpression) => void; export declare const num: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type) => void; export declare const str: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type) => void; export declare const bin: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type) => void; export declare const const_: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type) => void; export declare const arr: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type, encodeFn: JsonEncoderFunction) => void; export declare const tup: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type, encodeFn: JsonEncoderFunction) => void; export declare const obj: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type, encodeFn: JsonEncoderFunction) => void; export declare const map: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type, encodeFn: JsonEncoderFunction) => void; export declare const ref: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type) => void; export declare const or: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type, encodeFn: JsonEncoderFunction) => void; /** * Main router function that dispatches JSON encoding to the appropriate * encoder function based on the type's kind. */ export declare const generate: (ctx: JsonEncoderCodegenContext, value: JsExpression, type: Type) => void; export {};