-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ taxonomy and terms implementation in types
- Loading branch information
1 parent
09e168f
commit b89ba0c
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |