nyx Typedoc
    Preparing search index...

    Interface CommandRepository<Types>

    An object responsible for storing commands.

    interface CommandRepository<Types extends InteractionTypes = InteractionTypes> {
        size: number;
        "[iterator]"(): IterableIterator<
            [string, TopLevelCommand<Types>],
            any,
            any,
        >;
        addCommand(command: TopLevelCommand<Types>): this;
        clear(): void;
        entries(): IterableIterator<[string, TopLevelCommand<Types>]>;
        getCommandByName(id: string): TopLevelCommand<Types> | null;
        getCommands(): ReadonlyCollection<string, TopLevelCommand<Types>>;
        isCommandId(id: string): boolean;
        isCommandInstance(instance: TopLevelCommand<Types>): boolean;
        keys(): IterableIterator<string>;
        locateByClassTree<T extends ImplementsSubCommandGroup<Types>>(
            ParentCommandClass: ImplementsParentCommand<Types>,
            SubCommandGroupClass: T,
        ): InstanceType<T> | null;
        locateByClassTree<T extends ImplementsSubCommand<Types>>(
            ParentCommandClass: ImplementsParentCommand<Types>,
            SubCommandGroupClass: ImplementsSubCommandGroup<Types>,
            SubCommandClass: T,
        ): InstanceType<T> | null;
        locateByClassTree<T extends ImplementsSubCommand<Types>>(
            ParentCommandClass: ImplementsParentCommand<Types>,
            SubCommandClass: T,
        ): InstanceType<T> | null;
        locateByClassTree<T extends ImplementsParentCommand<Types>>(
            ParentCommandClass: T,
        ): InstanceType<T> | null;
        locateByClassTree<T extends ImplementsStandaloneCommand<Types>>(
            StandaloneCommandClass: T,
        ): InstanceType<T> | null;
        locateByClassTree<T extends ClassImplements<Command<Nameable, Types>>>(
            TopLevelCommandClass: ClassImplements<TopLevelCommand<Types>>,
            FirstChildClass?:
                | ImplementsSubCommandGroup<Types>
                | ImplementsSubCommand<Types>,
            SecondChildClass?: ImplementsSubCommand<Types>,
        ): InstanceType<T> | null;
        locateByNameTree(name: string): TopLevelCommand<Types> | null;
        locateByNameTree(
            parent: string,
            child: string,
        ): SubCommand<Types> | SubCommandGroup<Types> | null;
        locateByNameTree(
            parent: string,
            group: string,
            subCommand: string,
        ): SubCommand<Types> | null;
        locateByNameTree(
            parent: string,
            firstChild?: string,
            secondChild?: string,
        ):
            | TopLevelCommand<Types>
            | SubCommand<Types>
            | SubCommandGroup<Types>
            | null;
        next(
            ...__namedParameters: [] | [any],
        ): IteratorResult<[string, TopLevelCommand<Types>], any>;
        removeCommand(command: TopLevelCommand<Types>): this;
        return?(value?: any): IteratorResult<[string, TopLevelCommand<Types>], any>;
        throw?(e?: any): IteratorResult<[string, TopLevelCommand<Types>], any>;
        values(): IterableIterator<TopLevelCommand<Types>>;
    }

    Type Parameters

    Hierarchy

    Implemented by

    Index
    size: number

    Returns the number of stored commands.

    • Returns IterableIterator<[string, TopLevelCommand<Types>], any, any>

    • Parameters

      • ...__namedParameters: [] | [any]

      Returns IteratorResult<[string, TopLevelCommand<Types>], any>

    • Parameters

      • Optionalvalue: any

      Returns IteratorResult<[string, TopLevelCommand<Types>], any>

    • Parameters

      • Optionale: any

      Returns IteratorResult<[string, TopLevelCommand<Types>], any>