enonic-types
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -385,3 +385,17 @@ import { Region } from "./portal"; | ||
readonly icon: ReadonlyArray<IconType>; | ||
readonly form: ReadonlyArray<any>; | ||
readonly form: ReadonlyArray<FormItem>; | ||
} | ||
export declare type InputType = "Time" | "DateTime" | "CheckBox" | "ComboBox" | "Long" | "Double" | "RadioButton" | "TextArea" | "ContentTypeFilter" | "GeoPoint" | "TextLine" | "Tag" | "CustomSelector" | "AttachmentUploader" | "ContentSelector" | "MediaSelector" | "ImageSelector" | "HtmlArea"; | ||
export declare type FormItemType = "Input" | "ItemSet" | "Layout" | "OptionSet"; | ||
export interface FormItem<A = unknown> { | ||
readonly formItemType: FormItemType | string; | ||
readonly name: string; | ||
readonly label: string; | ||
readonly maximize: boolean; | ||
readonly inputType: InputType; | ||
readonly occurrences: { | ||
readonly maximum: 1; | ||
readonly minimum: 1; | ||
}; | ||
readonly config: A; | ||
} |
@@ -25,5 +25,5 @@ import { XOR } from "./types"; | ||
export declare type ResponseType = string | object | Array<any> | ReadonlyArray<any>; | ||
export interface HttpResponse<A> { | ||
export interface HttpResponse<A = ResponseType> { | ||
readonly status?: number; | ||
readonly body?: A | ResponseType; | ||
readonly body?: A; | ||
readonly contentType?: string; | ||
@@ -47,3 +47,3 @@ readonly headers?: { | ||
} | ||
export declare type Response<A = {}> = XOR<HttpResponse<A>, WebSocketResponse<A>>; | ||
export declare type Response<A = ResponseType> = XOR<HttpResponse<A>, WebSocketResponse<A>>; | ||
export interface MacroContext<A = never> { | ||
@@ -104,9 +104,7 @@ readonly name: string; | ||
*/ | ||
export declare type CustomSelectorServiceResponse = Omit<Response, "body"> & { | ||
body: { | ||
readonly total: number; | ||
readonly count: number; | ||
readonly hits: Array<CustomSelectorServiceResponseHit>; | ||
}; | ||
}; | ||
export declare type CustomSelectorServiceResponse = HttpResponse<{ | ||
readonly total: number; | ||
readonly count: number; | ||
readonly hits: Array<CustomSelectorServiceResponseHit>; | ||
}>; | ||
export interface CustomSelectorServiceResponseHit { | ||
@@ -113,0 +111,0 @@ readonly id: string; |
@@ -1,2 +0,2 @@ | ||
import { Content } from "./content"; | ||
import { Content, Site } from "./content"; | ||
export interface MenuLibrary { | ||
@@ -10,8 +10,18 @@ /** | ||
*/ | ||
getMenuTree(levels: number, params?: GetMenuParams): ReadonlyArray<MenuItem>; | ||
getMenuTree(levels: number, params?: GetMenuTreeParams): MenuTree; | ||
/** | ||
* Returns submenus of a parent menuitem. | ||
*/ | ||
getSubMenus(parentContent: Content<any>, levels?: number, params?: GetMenuParams): ReadonlyArray<MenuItem>; | ||
getSubMenus(parentContent: Content<any> | Site<any>, levels?: number, params?: GetMenuParams): ReadonlyArray<MenuItem>; | ||
} | ||
export interface MenuTree { | ||
/** | ||
* The list of menuItems and children | ||
*/ | ||
readonly menuItems: ReadonlyArray<MenuItem>; | ||
/** | ||
* The ariaLabel used for this menu | ||
*/ | ||
readonly ariaLabel?: string; | ||
} | ||
export interface GetBreadcrumbMenuParams { | ||
@@ -38,2 +48,6 @@ /** | ||
readonly urlType?: 'server' | 'absolute'; | ||
/** | ||
* The 'aria-label' attribute text on the '<nav>' element. This should be the name of the navigation, e.g "Breadcrumbs". | ||
*/ | ||
readonly ariaLabel?: string; | ||
} | ||
@@ -49,3 +63,7 @@ export interface BreadcrumbMenu { | ||
}>; | ||
readonly ariaLabel?: string; | ||
} | ||
export declare type GetMenuTreeParams = GetMenuParams & { | ||
readonly ariaLabel?: string; | ||
}; | ||
export interface GetMenuParams { | ||
@@ -56,2 +74,10 @@ /** | ||
readonly urlType?: 'server' | 'absolute'; | ||
/** | ||
* Controls what info to return | ||
*/ | ||
readonly returnContent?: boolean; | ||
/** | ||
* Query string to add when searching for menu items | ||
*/ | ||
readonly query?: string; | ||
} | ||
@@ -58,0 +84,0 @@ export interface MenuItem { |
{ | ||
"name": "enonic-types", | ||
"sideEffects": false, | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "TypeScript types for Enonic XP", | ||
@@ -6,0 +6,0 @@ "typings": "index.d.ts", |
81581
2407