Refactor on DynamicDialog d.ts files

pull/2669/head
mertsincan 2022-06-14 13:45:31 +01:00
parent e520b266f2
commit e558815fdb
3 changed files with 27 additions and 26 deletions

View File

@ -1,37 +1,17 @@
import { Plugin, VNode } from 'vue';
import { DynamicDialogOptions } from '../dynamicdialogoptions';
import { DynamicDialogOptions, DynamicDialogInstance } from '../dynamicdialogoptions';
declare const plugin: Plugin;
export default plugin;
export interface DialogInstance {
/**
* Dynamic component for content template
*/
content: VNode | undefined;
/**
* Instance options
* @see DynamicDialogOptions
*/
options: DynamicDialogOptions;
/**
* Custom data object
*/
data: any;
/**
* Closes the dialog.
* @param {*} params - Parameters sent by the user to the root instance
*/
close: (params?: any) => void;
}
export interface DialogServiceMethods {
/**
* Displays the dialog using the dynamic dialog object options.
* @param {VNode} content - Dynamic component for content template
* @param {DynamicDialogOptions} options - DynamicDialog Object
* @return {@link DynamicDialogInstance}
*/
open(content: VNode, options?: DynamicDialogOptions): DialogInstance;
open: (content: VNode, options?: DynamicDialogOptions) => DynamicDialogInstance;
}
declare module 'vue/types/vue' {

View File

@ -51,3 +51,24 @@ export interface DynamicDialogOptions {
*/
[key: string]: any;
}
export interface DynamicDialogInstance {
/**
* Dynamic component for content template
*/
content: VNode | undefined;
/**
* Instance options
* @see DynamicDialogOptions
*/
options: DynamicDialogOptions;
/**
* Custom data object
*/
data: any;
/**
* Closes the dialog.
* @param {*} params - Parameters sent by the user to the root instance
*/
close: (params?: any) => void;
}

View File

@ -1,6 +1,6 @@
//import { DynamicDialogOptions } from '../dynamicdialogoptions';
import { VNode } from 'vue';
import { DynamicDialogOptions, DynamicDialogInstance } from '../dynamicdialogoptions';
export declare function useDialog(): {
open: (dialog: any) => void;
close: () => void;
open: (content: VNode, options?: DynamicDialogOptions) => DynamicDialogInstance;
}