/** * This code was GENERATED using the solita package. * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality. * * See: https://github.com/metaplex-foundation/solita */ import * as beet from '@metaplex-foundation/beet'; import { VecMap } from './VecMap'; /** * This type is used to derive the {@link Schema} type as well as the de/serializer. * However don't refer to it in your code but use the {@link Schema} type instead. * * @category userTypes * @category enums * @category generated * @private */ export type SchemaRecord = { Null: void; Bool: void; Number: void; String: void; Array: { fields: [Schema]; }; Object: { fields: [VecMap]; }; Pubkey: void; Option: { fields: [Schema]; }; VecMap: { fields: [Schema, Schema]; }; Enum: { fields: [VecMap]; }; Any: void; }; /** * Union type respresenting the Schema data enum defined in Rust. * * NOTE: that it includes a `__kind` property which allows to narrow types in * switch/if statements. * Additionally `isSchema*` type guards are exposed below to narrow to a specific variant. * * @category userTypes * @category enums * @category generated */ export type Schema = beet.DataEnumKeyAsKind; export declare const isSchemaNull: (x: Schema) => x is { __kind: "Null"; } & Omit & { __kind: 'Null'; }; export declare const isSchemaBool: (x: Schema) => x is { __kind: "Bool"; } & Omit & { __kind: 'Bool'; }; export declare const isSchemaNumber: (x: Schema) => x is { __kind: "Number"; } & Omit & { __kind: 'Number'; }; export declare const isSchemaString: (x: Schema) => x is { __kind: "String"; } & Omit & { __kind: 'String'; }; export declare const isSchemaArray: (x: Schema) => x is { __kind: "Array"; } & Omit<{ fields: [Schema]; }, "void"> & { __kind: 'Array'; }; export declare const isSchemaObject: (x: Schema) => x is { __kind: "Object"; } & Omit<{ fields: [VecMap]; }, "void"> & { __kind: 'Object'; }; export declare const isSchemaPubkey: (x: Schema) => x is { __kind: "Pubkey"; } & Omit & { __kind: 'Pubkey'; }; export declare const isSchemaOption: (x: Schema) => x is { __kind: "Option"; } & Omit<{ fields: [Schema]; }, "void"> & { __kind: 'Option'; }; export declare const isSchemaVecMap: (x: Schema) => x is { __kind: "VecMap"; } & Omit<{ fields: [Schema, Schema]; }, "void"> & { __kind: 'VecMap'; }; export declare const isSchemaEnum: (x: Schema) => x is { __kind: "Enum"; } & Omit<{ fields: [VecMap]; }, "void"> & { __kind: 'Enum'; }; export declare const isSchemaAny: (x: Schema) => x is { __kind: "Any"; } & Omit & { __kind: 'Any'; }; export declare const schemaBeet: beet.FixableBeet;