UNPKG

@jsonjoy.com/json-type

Version:

High-performance JSON Pointer implementation

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