How to use Aurelia third party plugin with without typescript definition file?

。_饼干妹妹 提交于 2019-12-06 11:12:47
Jeremy Danyow

Looks like the aurelia-dialog build hasn't been configured to produce TypeScript definition files yet. This will probably be added soon. In the meantime you could add an aurelia-dialog.d.ts file to your project with the following:

declare module 'aurelia-dialog' {
  export class DialogService {
    open(settings: any): Promise;
  }
  export class DialogController {
    constructor(renderer, settings, resolve, reject);
    ok(result: any): Promise<DialogResult>;
    cancel(result: any): Promise<DialogResult>;
    error(message): Promise<DialogResult>;
    close(ok: boolean, result: any): Promise<DialogResult>;
    settings: {lock: boolean, centerHorizontalOnly: boolean };
  }

  export class DialogResult {
    wasCancelled: boolean;
    output: any;
    constructor(cancelled: boolean, result: any);
  }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!