@servicenow/sdk - v4.4.1
    Preparing search index...
    interface StatementedNode {
        addClass(
            structure: OptionalKind<ClassDeclarationStructure>,
        ): ClassDeclaration;
        addClasses(
            structures: readonly OptionalKind<ClassDeclarationStructure>[],
        ): ClassDeclaration[];
        addEnum(structure: OptionalKind<EnumDeclarationStructure>): EnumDeclaration;
        addEnums(
            structures: readonly OptionalKind<EnumDeclarationStructure>[],
        ): EnumDeclaration[];
        addFunction(
            structure: OptionalKind<FunctionDeclarationStructure>,
        ): FunctionDeclaration;
        addFunctions(
            structures: readonly OptionalKind<FunctionDeclarationStructure>[],
        ): FunctionDeclaration[];
        addInterface(
            structure: OptionalKind<InterfaceDeclarationStructure>,
        ): InterfaceDeclaration;
        addInterfaces(
            structures: readonly OptionalKind<InterfaceDeclarationStructure>[],
        ): InterfaceDeclaration[];
        addModule(
            structure: OptionalKind<ModuleDeclarationStructure>,
        ): ModuleDeclaration;
        addModules(
            structures: readonly OptionalKind<ModuleDeclarationStructure>[],
        ): ModuleDeclaration[];
        addStatements(
            statements:
                | string
                | WriterFunction
                | readonly (string | WriterFunction | StatementStructures)[],
        ): Statement<tsc.Statement>[];
        addTypeAlias(
            structure: OptionalKind<TypeAliasDeclarationStructure>,
        ): TypeAliasDeclaration;
        addTypeAliases(
            structures: readonly OptionalKind<TypeAliasDeclarationStructure>[],
        ): TypeAliasDeclaration[];
        addVariableStatement(
            structure: OptionalKind<VariableStatementStructure>,
        ): VariableStatement;
        addVariableStatements(
            structures: readonly OptionalKind<VariableStatementStructure>[],
        ): VariableStatement[];
        getClass(name: string): ClassDeclaration | undefined;
        getClass(
            findFunction: (declaration: ClassDeclaration) => boolean,
        ): ClassDeclaration | undefined;
        getClasses(): ClassDeclaration[];
        getClassOrThrow(name: string): ClassDeclaration;
        getClassOrThrow(
            findFunction: (declaration: ClassDeclaration) => boolean,
        ): ClassDeclaration;
        getEnum(name: string): EnumDeclaration | undefined;
        getEnum(
            findFunction: (declaration: EnumDeclaration) => boolean,
        ): EnumDeclaration | undefined;
        getEnumOrThrow(name: string): EnumDeclaration;
        getEnumOrThrow(
            findFunction: (declaration: EnumDeclaration) => boolean,
        ): EnumDeclaration;
        getEnums(): EnumDeclaration[];
        getFunction(name: string): FunctionDeclaration | undefined;
        getFunction(
            findFunction: (declaration: FunctionDeclaration) => boolean,
        ): FunctionDeclaration | undefined;
        getFunctionOrThrow(name: string): FunctionDeclaration;
        getFunctionOrThrow(
            findFunction: (declaration: FunctionDeclaration) => boolean,
        ): FunctionDeclaration;
        getFunctions(): FunctionDeclaration[];
        getInterface(name: string): InterfaceDeclaration | undefined;
        getInterface(
            findFunction: (declaration: InterfaceDeclaration) => boolean,
        ): InterfaceDeclaration | undefined;
        getInterfaceOrThrow(name: string): InterfaceDeclaration;
        getInterfaceOrThrow(
            findFunction: (declaration: InterfaceDeclaration) => boolean,
        ): InterfaceDeclaration;
        getInterfaces(): InterfaceDeclaration[];
        getModule(name: string): ModuleDeclaration | undefined;
        getModule(
            findFunction: (declaration: ModuleDeclaration) => boolean,
        ): ModuleDeclaration | undefined;
        getModuleOrThrow(name: string): ModuleDeclaration;
        getModuleOrThrow(
            findFunction: (declaration: ModuleDeclaration) => boolean,
        ): ModuleDeclaration;
        getModules(): ModuleDeclaration[];
        getStatement<T extends Statement<tsc.Statement>>(
            findFunction: (statement: Statement) => statement is T,
        ): T | undefined;
        getStatement(
            findFunction: (statement: Statement) => boolean,
        ): Statement<tsc.Statement> | undefined;
        getStatementByKind<TKind extends tsc.SyntaxKind>(
            kind: TKind,
        ): KindToNodeMappingsWithCommentStatements[TKind] | undefined;
        getStatementByKindOrThrow<TKind extends tsc.SyntaxKind>(
            kind: TKind,
        ): KindToNodeMappingsWithCommentStatements[TKind];
        getStatementOrThrow<T extends Statement<tsc.Statement>>(
            findFunction: (statement: Statement) => statement is T,
        ): T;
        getStatementOrThrow(
            findFunction: (statement: Statement) => boolean,
        ): Statement;
        getStatements(): Statement<tsc.Statement>[];
        getStatementsWithComments(): Statement<tsc.Statement>[];
        getTypeAlias(name: string): TypeAliasDeclaration | undefined;
        getTypeAlias(
            findFunction: (declaration: TypeAliasDeclaration) => boolean,
        ): TypeAliasDeclaration | undefined;
        getTypeAliases(): TypeAliasDeclaration[];
        getTypeAliasOrThrow(name: string): TypeAliasDeclaration;
        getTypeAliasOrThrow(
            findFunction: (declaration: TypeAliasDeclaration) => boolean,
        ): TypeAliasDeclaration;
        getVariableDeclaration(name: string): VariableDeclaration | undefined;
        getVariableDeclaration(
            findFunction: (declaration: VariableDeclaration) => boolean,
        ): VariableDeclaration | undefined;
        getVariableDeclarationOrThrow(name: string): VariableDeclaration;
        getVariableDeclarationOrThrow(
            findFunction: (declaration: VariableDeclaration) => boolean,
        ): VariableDeclaration;
        getVariableDeclarations(): VariableDeclaration[];
        getVariableStatement(name: string): VariableStatement | undefined;
        getVariableStatement(
            findFunction: (declaration: VariableStatement) => boolean,
        ): VariableStatement | undefined;
        getVariableStatementOrThrow(name: string): VariableStatement;
        getVariableStatementOrThrow(
            findFunction: (declaration: VariableStatement) => boolean,
        ): VariableStatement;
        getVariableStatements(): VariableStatement[];
        insertClass(
            index: number,
            structure: OptionalKind<ClassDeclarationStructure>,
        ): ClassDeclaration;
        insertClasses(
            index: number,
            structures: readonly OptionalKind<ClassDeclarationStructure>[],
        ): ClassDeclaration[];
        insertEnum(
            index: number,
            structure: OptionalKind<EnumDeclarationStructure>,
        ): EnumDeclaration;
        insertEnums(
            index: number,
            structures: readonly OptionalKind<EnumDeclarationStructure>[],
        ): EnumDeclaration[];
        insertFunction(
            index: number,
            structure: OptionalKind<FunctionDeclarationStructure>,
        ): FunctionDeclaration;
        insertFunctions(
            index: number,
            structures: readonly OptionalKind<FunctionDeclarationStructure>[],
        ): FunctionDeclaration[];
        insertInterface(
            index: number,
            structure: OptionalKind<InterfaceDeclarationStructure>,
        ): InterfaceDeclaration;
        insertInterfaces(
            index: number,
            structures: readonly OptionalKind<InterfaceDeclarationStructure>[],
        ): InterfaceDeclaration[];
        insertModule(
            index: number,
            structure: OptionalKind<ModuleDeclarationStructure>,
        ): ModuleDeclaration;
        insertModules(
            index: number,
            structures: readonly OptionalKind<ModuleDeclarationStructure>[],
        ): ModuleDeclaration[];
        insertStatements(
            index: number,
            statements:
                | string
                | WriterFunction
                | readonly (string | WriterFunction | StatementStructures)[],
        ): Statement<tsc.Statement>[];
        insertTypeAlias(
            index: number,
            structure: OptionalKind<TypeAliasDeclarationStructure>,
        ): TypeAliasDeclaration;
        insertTypeAliases(
            index: number,
            structures: readonly OptionalKind<TypeAliasDeclarationStructure>[],
        ): TypeAliasDeclaration[];
        insertVariableStatement(
            index: number,
            structure: OptionalKind<VariableStatementStructure>,
        ): VariableStatement;
        insertVariableStatements(
            index: number,
            structures: readonly OptionalKind<VariableStatementStructure>[],
        ): VariableStatement[];
        removeStatement(index: number): this;
        removeStatements(indexRange: [number, number]): this;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Gets a class.

      Parameters

      • name: string

        Name of the class.

      Returns ClassDeclaration | undefined

    • Gets a class.

      Parameters

      • findFunction: (declaration: ClassDeclaration) => boolean

        Function to use to find the class.

      Returns ClassDeclaration | undefined

    • Gets the direct class declaration children.

      Returns ClassDeclaration[]

    • Gets a class or throws if it doesn't exist.

      Parameters

      • name: string

        Name of the class.

      Returns ClassDeclaration

    • Gets a class or throws if it doesn't exist.

      Parameters

      • findFunction: (declaration: ClassDeclaration) => boolean

        Function to use to find the class.

      Returns ClassDeclaration

    • Gets an enum.

      Parameters

      • name: string

        Name of the enum.

      Returns EnumDeclaration | undefined

    • Gets an enum.

      Parameters

      • findFunction: (declaration: EnumDeclaration) => boolean

        Function to use to find the enum.

      Returns EnumDeclaration | undefined

    • Gets an enum or throws if it doesn't exist.

      Parameters

      • name: string

        Name of the enum.

      Returns EnumDeclaration

    • Gets an enum or throws if it doesn't exist.

      Parameters

      • findFunction: (declaration: EnumDeclaration) => boolean

        Function to use to find the enum.

      Returns EnumDeclaration

    • Gets the direct enum declaration children.

      Returns EnumDeclaration[]

    • Gets a function.

      Parameters

      • name: string

        Name of the function.

      Returns FunctionDeclaration | undefined

    • Gets a function.

      Parameters

      • findFunction: (declaration: FunctionDeclaration) => boolean

        Function to use to find the function.

      Returns FunctionDeclaration | undefined

    • Gets a function or throws if it doesn't exist.

      Parameters

      • name: string

        Name of the function.

      Returns FunctionDeclaration

    • Gets a function or throws if it doesn't exist.

      Parameters

      • findFunction: (declaration: FunctionDeclaration) => boolean

        Function to use to find the function.

      Returns FunctionDeclaration

    • Gets the direct function declaration children.

      Returns FunctionDeclaration[]

    • Gets an interface.

      Parameters

      • name: string

        Name of the interface.

      Returns InterfaceDeclaration | undefined

    • Gets an interface.

      Parameters

      Returns InterfaceDeclaration | undefined

    • Gets an interface or throws if it doesn't exist.

      Parameters

      • name: string

        Name of the interface.

      Returns InterfaceDeclaration

    • Gets an interface or throws if it doesn't exist.

      Parameters

      Returns InterfaceDeclaration

    • Gets the direct interface declaration children.

      Returns InterfaceDeclaration[]

    • Gets a module declaration child by name.

      Parameters

      • name: string

        Name of the namespace.

      Returns ModuleDeclaration | undefined

    • Gets a module declaration child by condition.

      Parameters

      • findFunction: (declaration: ModuleDeclaration) => boolean

        Function to use to find the namespace.

      Returns ModuleDeclaration | undefined

    • Gets a module declaration child by name or throws if it doesn't exist.

      Parameters

      • name: string

        Name of the namespace.

      Returns ModuleDeclaration

    • Gets a module declaration child by condition or throws if it doesn't exist.

      Parameters

      • findFunction: (declaration: ModuleDeclaration) => boolean

        Function to use to find the namespace.

      Returns ModuleDeclaration

    • Gets the module declaration children.

      Returns ModuleDeclaration[]

    • Gets the first statement that matches the provided condition or returns undefined if it doesn't exist.

      Type Parameters

      Parameters

      • findFunction: (statement: Statement) => statement is T

        Function to find the statement by.

      Returns T | undefined

    • Gets the first statement that matches the provided condition or returns undefined if it doesn't exist.

      Parameters

      • findFunction: (statement: Statement) => boolean

        Function to find the statement by.

      Returns Statement<tsc.Statement> | undefined

    • Gets the first statement that matches the provided condition or throws if it doesn't exist.

      Type Parameters

      Parameters

      • findFunction: (statement: Statement) => statement is T

        Function to find the statement by.

      Returns T

    • Gets the first statement that matches the provided condition or throws if it doesn't exist.

      Parameters

      • findFunction: (statement: Statement) => boolean

        Function to find the statement by.

      Returns Statement

    • Gets the node's statements with comment statements.

      Returns Statement<tsc.Statement>[]

    • Gets a type alias.

      Parameters

      • name: string

        Name of the type alias.

      Returns TypeAliasDeclaration | undefined

    • Gets a type alias.

      Parameters

      • findFunction: (declaration: TypeAliasDeclaration) => boolean

        Function to use to find the type alias.

      Returns TypeAliasDeclaration | undefined

    • Gets the direct type alias declaration children.

      Returns TypeAliasDeclaration[]

    • Gets a type alias or throws if it doesn't exist.

      Parameters

      • name: string

        Name of the type alias.

      Returns TypeAliasDeclaration

    • Gets a type alias or throws if it doesn't exist.

      Parameters

      • findFunction: (declaration: TypeAliasDeclaration) => boolean

        Function to use to find the type alias.

      Returns TypeAliasDeclaration

    • Gets a variable declaration.

      Parameters

      • name: string

        Name of the variable declaration.

      Returns VariableDeclaration | undefined

    • Gets a variable declaration.

      Parameters

      • findFunction: (declaration: VariableDeclaration) => boolean

        Function to use to find the variable declaration.

      Returns VariableDeclaration | undefined

    • Gets a variable declaration or throws if it doesn't exist.

      Parameters

      • name: string

        Name of the variable declaration.

      Returns VariableDeclaration

    • Gets a variable declaration or throws if it doesn't exist.

      Parameters

      • findFunction: (declaration: VariableDeclaration) => boolean

        Function to use to find the variable declaration.

      Returns VariableDeclaration

    • Gets all the variable declarations within the variable statement children.

      Returns VariableDeclaration[]

      This does not return the variable declarations within for statements or for of statements.

    • Gets a variable statement.

      Parameters

      • name: string

        Name of one of the variable statement's declarations.

      Returns VariableStatement | undefined

    • Gets a variable statement.

      Parameters

      • findFunction: (declaration: VariableStatement) => boolean

        Function to use to find the variable statement.

      Returns VariableStatement | undefined

    • Gets a variable statement or throws if it doesn't exist.

      Parameters

      • name: string

        Name of one of the variable statement's declarations.

      Returns VariableStatement

    • Gets a variable statement or throws if it doesn't exist.

      Parameters

      • findFunction: (declaration: VariableStatement) => boolean

        Function to use to find the variable statement.

      Returns VariableStatement

    • Gets the direct variable statement children.

      Returns VariableStatement[]

    • Removes the statement at the specified index.

      Parameters

      • index: number

        Child index to remove the statement at.

      Returns this

    • Removes the statements at the specified index range.

      Parameters

      • indexRange: [number, number]

        The start and end inclusive index range to remove.

      Returns this