Skip to content

Commit

Permalink
feat: ✨ taxonomy and terms implementation for typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithad0703 committed Oct 6, 2023
1 parent c6daba3 commit 555987d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
22 changes: 22 additions & 0 deletions types/stack/taxonomy/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AnyProperty, SystemFields } from "../../utility/fields";
import { Creatable, Queryable, SystemFunction } from "../../utility/operations";
import { Term, Terms } from "../taxonomy/terms"

export interface Taxonomy extends SystemFields, SystemFunction<Taxonomy> {
term(): Terms
term(uid: string): Term
}

export interface Taxonomy extends SystemFields, SystemFunction<Taxonomy> {
}

export interface Taxonomies extends Queryable<Taxonomy, {taxonomy: TaxonomyData}> {
}

export interface Taxonomies extends Creatable<Taxonomy, {taxonomy: TaxonomyData}> {
}

export interface TaxonomyData extends AnyProperty {
name: string
taxonomy_uid: string
}
19 changes: 19 additions & 0 deletions types/stack/taxonomy/terms/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { AnyProperty, SystemFields } from "../../../utility/fields";
import { Creatable, Queryable, SystemFunction } from "../../../utility/operations";

export interface Term extends SystemFields, SystemFunction<Term> {
ancestors(data: {term_uid: TermData, include_children_count: boolean, include_referenced_entries_count: boolean, include_count: boolean, skip: number, limit: number}): Promise<Response>
}

export interface Term extends Creatable<Term, {term: TermData}> {
}

export interface Terms extends Queryable<Term, {term: TermData}> {
}

export interface TermData extends AnyProperty {
name: string
term_uid: string
taxonomy_uid: string
parent_uid?: string
}

0 comments on commit 555987d

Please sign in to comment.