mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
create AposConstructor Type, add beforeConstruct in ModuleOptions (#29445)
* create AposConstructor Type, add beforeConstruct in ModuleOptions * Add all options to AposConstructor
This commit is contained in:
committed by
Wesley Wigham
parent
52a012c362
commit
8baf389b69
20
types/apostrophe/index.d.ts
vendored
20
types/apostrophe/index.d.ts
vendored
@@ -7,7 +7,10 @@
|
||||
export = apostrophe;
|
||||
export as namespace apos;
|
||||
|
||||
declare function apostrophe(options: any, ...args: any[]): any;
|
||||
declare function apostrophe(
|
||||
options: apostrophe.AposConstructor,
|
||||
...args: any[]
|
||||
): any;
|
||||
|
||||
declare namespace apostrophe {
|
||||
const moogBundle: {
|
||||
@@ -15,6 +18,20 @@ declare namespace apostrophe {
|
||||
modules: string[];
|
||||
};
|
||||
|
||||
// Pass in custom modules as first argument
|
||||
// second argument is additional custom options e.g. restApi exposed by apostrophe-headless
|
||||
interface AposConstructor<M = {}, O = {}> {
|
||||
afterInit?: () => void;
|
||||
afterListen?: () => void;
|
||||
initFailed?: (error: any) => void;
|
||||
baseUrl?: string;
|
||||
modules: { [K in AposCoreModules & M]?: AposModuleOptions | O };
|
||||
prefix?: string;
|
||||
root?: string;
|
||||
rootDir?: string;
|
||||
shortName: string;
|
||||
}
|
||||
|
||||
const ui: {
|
||||
globalBusy: (state: any) => any;
|
||||
link: (
|
||||
@@ -297,6 +314,7 @@ declare namespace apostrophe {
|
||||
label: string;
|
||||
fields: string[];
|
||||
}[];
|
||||
beforeConstruct?: (self: any, options: any) => any;
|
||||
defer?: boolean;
|
||||
filters?: {
|
||||
projection?: {
|
||||
|
||||
Reference in New Issue
Block a user