@goteborgco/open-api-js-client
Version:
Official JavaScript client for the Göteborg & Co GraphQL API
37 lines (36 loc) • 855 B
TypeScript
/**
* Represents a single term within a taxonomy
*/
export declare class TaxonomyTerm {
readonly id: number;
readonly name: string;
readonly count: number;
readonly description: string;
readonly parent?: number;
readonly children: TaxonomyTerm[];
constructor(data: any);
/**
* Check if this term has a parent
*/
hasParent(): boolean;
/**
* Get the parent ID if it exists
*/
getParentId(): number | undefined;
/**
* Check if this term has children
*/
hasChildren(): boolean;
/**
* Get all children of this term
*/
getChildren(): TaxonomyTerm[];
/**
* Get the number of direct children
*/
getChildCount(): number;
/**
* Get all descendant terms (children, grandchildren, etc.)
*/
getAllDescendants(): TaxonomyTerm[];
}