import type { Node } from 'web-tree-sitter'; const TYPE = 'executable_directive_location' as const; // ================================================================ // ================================================================ // // ExecutableDirectiveLocationNode // // GraphQL executable directive location node // // ================================================================ // ================================================================ /** * Represents a executable directive location in the GraphQL AST. * */ export interface ExecutableDirectiveLocationNode extends Node { type: typeof TYPE; } // ================================================================ // ================================================================ // // Type Guard // // ================================================================ // ================================================================ /** * Type guard to check if a node is a {@link ExecutableDirectiveLocationNode}. * * @param node - The node to check * @returns True if the node is a {@link ExecutableDirectiveLocationNode} * * @example * ```typescript * if (isExecutableDirectiveLocationNode(node)) { * // TypeScript now knows node is ExecutableDirectiveLocationNode * console.log(node.type); // 'executable_directive_location' * } * ``` */ export function isExecutableDirectiveLocationNode(node: unknown): node is ExecutableDirectiveLocationNode { return (node as any)?.type === TYPE; } // ================================================================ // ================================================================ // // Constructor // // ================================================================ // ================================================================ /** * Creates a new {@link ExecutableDirectiveLocationNode} with the specified properties. * * @returns A new {@link ExecutableDirectiveLocationNode} * * @example * ```typescript * const node = ExecutableDirectiveLocationNode({ * // properties... * }); * ``` */ export function ExecutableDirectiveLocationNode(props: Omit): ExecutableDirectiveLocationNode { return { type: TYPE, ...props }; }