enonic-types
Advanced tools
Comparing version 0.0.29 to 0.0.30
import { Region } from "./portal"; | ||
export interface ContentLibrary { | ||
get<A extends object, PageConfig extends object = never>(params: GetContentParams): Content<A, PageConfig> | null; | ||
query<A extends object>(params: QueryContentParams): QueryResponse<A>; | ||
query<A extends object, B extends string = never>(params: QueryContentParams<B>): QueryResponse<A, B>; | ||
create<A extends object>(params: CreateContentParams<A>): Content<A>; | ||
@@ -76,3 +76,3 @@ modify<A extends object>(params: ModifyContentParams<A>): Content<A>; | ||
} | ||
export interface QueryContentParams { | ||
export interface QueryContentParams<B extends string = never> { | ||
readonly start?: number; | ||
@@ -83,11 +83,11 @@ readonly count: number; | ||
readonly sort?: string; | ||
readonly aggregations?: Record<string, Aggregation>; | ||
readonly aggregations?: Record<B, Aggregation>; | ||
readonly contentTypes?: ReadonlyArray<string>; | ||
readonly highlight?: Highlight; | ||
} | ||
export interface QueryResponse<A extends object> { | ||
export interface QueryResponse<A extends object, B extends string = never> { | ||
readonly count: number; | ||
readonly hits: ReadonlyArray<Content<A>>; | ||
readonly total: number; | ||
readonly aggregations: AggregationsResponse; | ||
readonly aggregations: AggregationsResponse<B>; | ||
readonly highlight: HighlightResponse; | ||
@@ -187,3 +187,5 @@ } | ||
} | ||
export declare type AggregationsResponse = Record<string, AggregationsResponseEntry>; | ||
export declare type AggregationsResponse<B extends string> = { | ||
[K in B]: AggregationsResponseEntry; | ||
}; | ||
export interface Highlight { | ||
@@ -190,0 +192,0 @@ encoder?: 'default' | 'html'; |
{ | ||
"name": "enonic-types", | ||
"version": "0.0.29", | ||
"version": "0.0.30", | ||
"description": "TypeScript types for Enonic XP", | ||
@@ -27,8 +27,8 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^2.19.0", | ||
"@typescript-eslint/parser": "^2.19.0", | ||
"@typescript-eslint/eslint-plugin": "^2.19.2", | ||
"@typescript-eslint/parser": "^2.19.2", | ||
"eslint": "^6.8.0", | ||
"rimraf": "^3.0.1", | ||
"rimraf": "^3.0.2", | ||
"typescript": "^3.7.5" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39626
32
1113