/** * 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 web3 from '@solana/web3.js'; import * as beet from '@metaplex-foundation/beet'; import { Number } from './Number'; import { VecMap } from './VecMap'; import { Schema } from './Schema'; /** * This type is used to derive the {@link SchemaValue} type as well as the de/serializer. * However don't refer to it in your code but use the {@link SchemaValue} type instead. * * @category userTypes * @category enums * @category generated * @private */ export type SchemaValueRecord = { Null: void; Bool: { fields: [boolean]; }; Number: { fields: [Number]; }; String: { fields: [string]; }; Array: { fields: [SchemaValue[]]; }; Object: { fields: [VecMap]; }; Pubkey: { fields: [web3.PublicKey]; }; VecMap: { fields: [VecMap]; }; Enum: { fields: [string, SchemaValue]; }; Schema: { fields: [Schema]; }; }; /** * Union type respresenting the SchemaValue data enum defined in Rust. * * NOTE: that it includes a `__kind` property which allows to narrow types in * switch/if statements. * Additionally `isSchemaValue*` type guards are exposed below to narrow to a specific variant. * * @category userTypes * @category enums * @category generated */ export type SchemaValue = beet.DataEnumKeyAsKind; export declare const isSchemaValueNull: (x: SchemaValue) => x is { __kind: "Null"; } & Omit & { __kind: 'Null'; }; export declare const isSchemaValueBool: (x: SchemaValue) => x is { __kind: "Bool"; } & Omit<{ fields: [boolean]; }, "void"> & { __kind: 'Bool'; }; export declare const isSchemaValueNumber: (x: SchemaValue) => x is { __kind: "Number"; } & Omit<{ fields: [Number]; }, "void"> & { __kind: 'Number'; }; export declare const isSchemaValueString: (x: SchemaValue) => x is { __kind: "String"; } & Omit<{ fields: [string]; }, "void"> & { __kind: 'String'; }; export declare const isSchemaValueArray: (x: SchemaValue) => x is { __kind: "Array"; } & Omit<{ fields: [SchemaValue[]]; }, "void"> & { __kind: 'Array'; }; export declare const isSchemaValueObject: (x: SchemaValue) => x is { __kind: "Object"; } & Omit<{ fields: [VecMap]; }, "void"> & { __kind: 'Object'; }; export declare const isSchemaValuePubkey: (x: SchemaValue) => x is { __kind: "Pubkey"; } & Omit<{ fields: [web3.PublicKey]; }, "void"> & { __kind: 'Pubkey'; }; export declare const isSchemaValueVecMap: (x: SchemaValue) => x is { __kind: "VecMap"; } & Omit<{ fields: [VecMap]; }, "void"> & { __kind: 'VecMap'; }; export declare const isSchemaValueEnum: (x: SchemaValue) => x is { __kind: "Enum"; } & Omit<{ fields: [string, SchemaValue]; }, "void"> & { __kind: 'Enum'; }; export declare const isSchemaValueSchema: (x: SchemaValue) => x is { __kind: "Schema"; } & Omit<{ fields: [Schema]; }, "void"> & { __kind: 'Schema'; }; export declare const schemaValueBeet: beet.FixableBeet;