@drovp/types
Advanced tools
Comparing version 4.0.2 to 4.1.0
@@ -145,3 +145,3 @@ /** | ||
name: string; | ||
title?: string; | ||
title?: string | false; | ||
hint?: string | ((value: V, options: O, path: (string | number)[]) => string | number | null | undefined); | ||
@@ -181,2 +181,3 @@ description?: string | ((value: V, options: O, path: (string | number)[]) => string | number | null | undefined); | ||
max?: number; | ||
preselect?: boolean; | ||
validator?: (value: string, options: O, path: (string | number)[]) => boolean; | ||
@@ -290,2 +291,16 @@ asyncValidator?: (value: string, options: O, path: (string | number)[]) => Promise<boolean>; | ||
type Variant = 'success' | 'info' | 'warning' | 'danger'; | ||
export interface Flair { | ||
title: string; | ||
type?: Variant; | ||
description?: string; | ||
} | ||
export interface Badge { | ||
title: string; | ||
icon: string; | ||
type?: Variant; | ||
} | ||
// These are the only items processors deal with | ||
@@ -297,2 +312,4 @@ export type Item = ItemFile | ItemDirectory | ItemBlob | ItemString | ItemUrl; | ||
readonly created: number; | ||
flair?: Flair; | ||
badge?: Badge; | ||
} | ||
@@ -375,9 +392,14 @@ | ||
export type OutputMeta<T = {}> = T & { | ||
flair?: Flair; | ||
badge?: Badge; | ||
}; | ||
export interface OutputEmitters { | ||
file: (path: string) => void; | ||
directory: (path: string) => void; | ||
url: (url: string) => void; | ||
string: (contents: string, meta?: {type?: string}) => void; | ||
error: (error: Error | string) => void; | ||
warning: (message: string) => void; | ||
file: (path: string, meta?: OutputMeta) => void; | ||
directory: (path: string, meta?: OutputMeta) => void; | ||
url: (url: string, meta?: OutputMeta) => void; | ||
string: (contents: string, meta?: OutputMeta<{type?: string}>) => void; | ||
error: (error: Error | string, meta?: OutputMeta) => void; | ||
warning: (message: string, meta?: OutputMeta) => void; | ||
} | ||
@@ -400,6 +422,45 @@ | ||
title(value: string | undefined | null): void; | ||
alert(data: ModalData): Promise<void>; | ||
confirm(data: ModalData): Promise<ModalResult<boolean>>; | ||
prompt( | ||
data: ModalData, | ||
stringOptions?: Omit<OptionString, 'title' | 'description' | 'type' | 'name'> | ||
): Promise<ModalResult<string>>; | ||
promptOptions<T extends OptionsData | undefined = undefined>( | ||
data: ModalData, | ||
schema: OptionsSchema<T> | ||
): Promise<ModalResult<T>>; | ||
showOpenDialog(options: OpenDialogOptions): Promise<OpenDialogReturnValue>; | ||
showSaveDialog(options: SaveDialogOptions): Promise<SaveDialogReturnValue>; | ||
openModalWindow<T = unknown>(options: string | OpenWindowOptions, payload: unknown): Promise<T>; | ||
} | ||
interface ModalData { | ||
variant?: Variant; | ||
title?: string; | ||
message?: string; | ||
details?: string; | ||
} | ||
export interface ModalResult<T = unknown> { | ||
canceled: boolean; | ||
payload: T; | ||
modifiers: string; | ||
} | ||
export interface OpenWindowOptions { | ||
path: string; | ||
title?: string; | ||
/** | ||
* Suggested width. | ||
*/ | ||
width?: number; | ||
/** | ||
* Suggested height. | ||
*/ | ||
height?: number; | ||
minWidth?: number; | ||
minHeight?: number; | ||
} | ||
interface Cleanup { | ||
@@ -409,2 +470,6 @@ (directoryPath: string): Promise<void>; | ||
interface Download { | ||
(url: string | URL, destination: string, options?: DownloadOptions): Promise<string>; | ||
} | ||
export interface DownloadOptions { | ||
@@ -418,4 +483,9 @@ onProgress?: (progress: {completed: number; total?: number}) => void; | ||
interface Download { | ||
(url: string | URL, destination: string, options?: DownloadOptions): Promise<string>; | ||
interface Extract { | ||
(archivePath: string, destinationPath: string, options: ExtractOptions & {listDetails: true}): Promise< | ||
ExtractListDetailItem[] | ||
>; | ||
(archivePath: string, options: ExtractOptions & {listDetails: true}): Promise<ExtractListDetailItem[]>; | ||
(archivePath: string, destinationPath: string, options?: ExtractOptions & {listDetails?: false}): Promise<string[]>; | ||
(archivePath: string, options?: ExtractOptions & {listDetails?: false}): Promise<string[]>; | ||
} | ||
@@ -430,11 +500,2 @@ | ||
interface Extract { | ||
(archivePath: string, destinationPath: string, options: ExtractOptions & {listDetails: true}): Promise< | ||
ExtractListDetailItem[] | ||
>; | ||
(archivePath: string, options: ExtractOptions & {listDetails: true}): Promise<ExtractListDetailItem[]>; | ||
(archivePath: string, destinationPath: string, options?: ExtractOptions & {listDetails?: false}): Promise<string[]>; | ||
(archivePath: string, options?: ExtractOptions & {listDetails?: false}): Promise<string[]>; | ||
} | ||
export interface ExtractListDetailItem { | ||
@@ -441,0 +502,0 @@ path: string; |
{ | ||
"name": "@drovp/types", | ||
"version": "4.0.2", | ||
"version": "4.1.0", | ||
"description": "Drovp plugin API definitions", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
22014
583