import { BlockContent, Entity, InlineContent, Node, TypeMap, Types, Unions } from '../types'; export declare type TypeMapGeneric = { type: Entity['type']; }> = { [key in T['type']]: key; }; declare type ExtractGeneric = Type extends TypeMap ? X : Type extends TypeMapGeneric ? Y : never; /** * Type guard to determine whether a node belongs to a type map * * @template {TypeMap} T * @param {T} typeMap * @param {Node} node A Stencila schema node object */ export declare const isInTypeMap: | TypeMapGeneric<{ type: Entity['type']; }>>>(typeMap: T) => (node?: unknown) => node is ExtractGeneric; /** * Type guard to determine whether a node is a primitive type * (i.e. not an `Entity`). */ export declare const isPrimitive: (node?: unknown) => node is string | number | boolean | null; /** * Type guard to determine whether a node is an `Entity` */ export declare const isEntity: (node?: unknown) => node is Entity; /** * A type guard to determine whether a node is of a specific type. * * e.g. `isA('Paragraph', node)` */ export declare const isA: (type: K, node: unknown) => node is Types[K]; /** * Returns a type guard to determine whether a node is of a specific type. * * e.g. `isType('Article')(node)` * e.g. `article.content.filter(isType('Paragraph'))` */ export declare const isType: (type: K) => (node?: unknown) => node is Types[K]; /** * A type guard to determine whether a node is a member of a union type. * * e.g. `isIn('MediaObjectTypes', node)` */ export declare const isIn: (union: K, node: unknown) => node is Unions[K]; /** * Returns a type guard to determine whether a node is a member of a union type. * * e.g. `isMember('CreativeWorkTypes')(node)` */ export declare const isMember: (type: K) => (node?: unknown) => node is Unions[K]; /** * Type guard to determine whether a node is `InlineContent`. * * e.g. `nodes.filter(isInlineContent)` */ export declare const isInlineContent: (node?: unknown) => node is InlineContent; /** * Type guard to determine whether a node is `BlockContent`. * * e.g. `nodes.filter(isBlockContent)` */ export declare const isBlockContent: (node?: unknown) => node is BlockContent; export {};