Skip to content

Commit

Permalink
TEMP: update dist typings for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Jul 30, 2021
1 parent e0d53bc commit 4879389
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 59 deletions.
43 changes: 43 additions & 0 deletions js/dist-typings/@types/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* @deprecated Please import `app` from a namespace instead of using it as a global variable.
*
* @example App in forum JS
* ```
* import app from 'flarum/forum/app';
* ```
*
* @example App in admin JS
* ```
* import app from 'flarum/admin/app';
* ```
*/
declare const app: any;

declare const m: import('mithril').Static;
declare const dayjs: typeof import('dayjs');

// Extend JQuery with our custom functions, defined with $.fn
interface JQuery {
/**
* Flarum's tooltip JQuery plugin.
*
* Do not use this directly. Instead use the `<Tooltip>` component that
* is exported from `flarum/common/components/Tooltip`.
*
* This may be removed in a future version of Flarum.
*/
tooltip: import('./tooltips/index').TooltipJQueryFunction;
}

/**
* For more info, see: https://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking
*
* In a nutshell, we need to add `ElementAttributesProperty` to tell Typescript
* what property on component classes to look at for attribute typings. For our
* Component class, this would be `attrs` (e.g. `this.attrs...`)
*/
interface JSX {
ElementAttributesProperty: {
attrs: Record<string, unknown>;
};
}
53 changes: 0 additions & 53 deletions js/dist-typings/@types/global/index.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion js/dist-typings/admin/components/AdminPage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ export default class AdminPage extends Page {
setting(key: any, fallback?: string): any;
dirty(): {};
isChanged(): number;
saveSettings(e: any): Promise<void>;
saveSettings(e: any): any;
}
import Page from "../../common/components/Page";
2 changes: 1 addition & 1 deletion js/dist-typings/admin/components/MailPage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export default class MailPage extends AdminPage {
} | undefined;
driverFields: any;
sendTestEmail(): void;
testEmailSuccessAlert: number | undefined;
testEmailSuccessAlert: any;
}
import AdminPage from "./AdminPage";
2 changes: 1 addition & 1 deletion js/dist-typings/admin/utils/saveSettings.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default function saveSettings(settings: any): Promise<any>;
export default function saveSettings(settings: any): any;
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import Mithril from 'mithril';
*/
export default class DiscussionsSearchSource implements SearchSource {
protected results: Map<string, unknown[]>;
search(query: string): Promise<Map<string, unknown[]>>;
search(query: string): any;
view(query: string): Array<Mithril.Vnode>;
}
2 changes: 1 addition & 1 deletion js/dist-typings/forum/components/UsersSearchSource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import Mithril from 'mithril';
*/
export default class UsersSearchResults implements SearchSource {
protected results: Map<string, unknown[]>;
search(query: string): Promise<void>;
search(query: string): any;
view(query: string): Array<Mithril.Vnode>;
}
2 changes: 1 addition & 1 deletion js/dist-typings/forum/states/NotificationListState.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export default class NotificationListState extends PaginatedListState<Notificati
/**
* Mark all of the notifications as read.
*/
markAllAsRead(): Promise<any> | undefined;
markAllAsRead(): any;
}

0 comments on commit 4879389

Please sign in to comment.