Skip to content

Commit

Permalink
Fix FrameViewer constructor signature
Browse files Browse the repository at this point in the history
Closes #2197
  • Loading branch information
ghost91- committed Aug 19, 2022
1 parent 7924e3d commit 8b7b693
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/foundry/client/apps/sidebar/tabs/settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ declare global {

/**
* A simple window application which shows the built documentation pages within an iframe
* @typeParam Options - the type of the options object
*/
class FrameViewer extends Application {
class FrameViewer<Options extends ApplicationOptions = ApplicationOptions> extends Application<Options> {
constructor(url: string, options?: Partial<Options>);

url: string;

/**
Expand All @@ -78,7 +81,7 @@ declare global {
*/
static override get defaultOptions(): typeof Application['defaultOptions'];

override getData(options?: Partial<ApplicationOptions>): Promise<{ src: string }>;
override getData(options?: Partial<Options>): Promise<{ src: string }>;

override close(options?: Application.CloseOptions): ReturnType<Application['close']>;
}
Expand Down
7 changes: 7 additions & 0 deletions test-d/foundry/client/apps/sidebar/tabs/settings.test-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { expectType } from 'tsd';

const frameViewer = new FrameViewer('https://foundryvtt.wiki/', {
title: 'My Title'
});

expectType<string>(frameViewer.url);

0 comments on commit 8b7b693

Please sign in to comment.