-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from DefinitelyTyped/master
Updating my own fork
- Loading branch information
Showing
837 changed files
with
49,141 additions
and
19,582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"ajv": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { AposModuleOptions } from "apostrophe"; | ||
|
||
type CustomModules = "first-custom-widgets"; | ||
|
||
const firstCustomWidgetOptions: AposModuleOptions = { | ||
extend: "apostrophe-widgets", | ||
label: "First Custom Widget", | ||
addFields: [ | ||
{ | ||
name: "title", | ||
label: "Custom Widget Title", | ||
type: "string" | ||
} | ||
] | ||
}; | ||
|
||
const secondCustomWidgetOptions: AposModuleOptions<CustomModules> = { | ||
extend: "first-custom-widgets", | ||
label: "Second Custom Widget", | ||
addFields: [ | ||
{ | ||
name: "title", | ||
label: "Custom Widget Title", | ||
type: "string" | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,300 @@ | ||
// Type definitions for apostrophe 2.67 | ||
// Project: https://github.com/apostrophecms/apostrophe#readme | ||
// Definitions by: Aaron Holderman <https://github.com/afholderman> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
|
||
export = apostrophe; | ||
export as namespace apos; | ||
|
||
declare function apostrophe(options: any, ...args: any[]): any; | ||
|
||
declare namespace apostrophe { | ||
const moogBundle: { | ||
directory: string; | ||
modules: string[]; | ||
}; | ||
|
||
const ui: { | ||
globalBusy: (state: any) => any; | ||
link: ( | ||
sel: string, | ||
verb: string, | ||
object: object, | ||
callback?: () => any | ||
) => any; | ||
}; | ||
|
||
const pages: { | ||
page: { _id: string; type: string; _url?: string }; | ||
}; | ||
|
||
const adminBar: { | ||
link: (name: string, callback: () => any) => void; | ||
}; | ||
|
||
function change(arg: object | string): any; | ||
|
||
function create(type: string, options: any, callback?: () => any): any; | ||
|
||
const contextPiece: { | ||
_id: string; | ||
title: string; | ||
slug: string; | ||
type: string; | ||
}; | ||
|
||
function define( | ||
type: string | string[], | ||
definition: any, | ||
extending?: any | ||
): any; | ||
|
||
const docs: { | ||
getManager: (type: string) => void; | ||
setManager: (type: string, manager: any) => void; | ||
lock: (id: string, callback?: () => any) => void; | ||
lockAndWatch: (id: string, callback?: () => any) => void; | ||
unlock: (_id: string, sync: any, callback?: () => any) => any; | ||
}; | ||
|
||
function emit(name: string, arg?: any): any; | ||
|
||
const modules: object; | ||
|
||
const modalSupport: { | ||
stack: any[]; | ||
initialized: boolean; | ||
depth: number; | ||
all: any[]; | ||
getTopModalOrBody: () => string; | ||
getLatestModal: () => null | string; | ||
closeTopModal: () => void; | ||
cancelTopModal: () => void; | ||
}; | ||
|
||
function notify(message: string | object, options: AposObject): any; | ||
|
||
function off(eventName: string, fn?: () => any): any; | ||
|
||
function on(eventName: string, fn?: () => any): any; | ||
|
||
const schemas: { | ||
convert: ( | ||
$el: HTMLElement, | ||
schema: Schema, | ||
data: any, | ||
options: any, | ||
callback?: () => any | ||
) => any; | ||
newInstance: (schema: Schema) => any; | ||
populate: ( | ||
data: any, | ||
name: string, | ||
$field: any, | ||
callback?: () => void, | ||
$el?: HTMLElement, | ||
field?: any | ||
) => any; | ||
returnToError: ( | ||
$el: HTMLElement, | ||
schema: Schema, | ||
errorPath: any, | ||
error: any, | ||
callback: () => any | ||
) => void; | ||
}; | ||
|
||
const utils: { | ||
capitalizeFirst: (s: string) => string; | ||
camelName: (s: string) => string; | ||
error: (msg: string) => void; | ||
generateId: () => string; | ||
}; | ||
|
||
const versions: { | ||
edit: (id: string, afterRevert?: () => void) => any; | ||
}; | ||
|
||
interface AposObject { | ||
[key: string]: any; | ||
} | ||
|
||
interface Field { | ||
name: string; | ||
type: string; | ||
label: string; | ||
required?: boolean; | ||
options?: AposObject; | ||
} | ||
|
||
type Fields = Field[]; | ||
|
||
interface AposType { | ||
name: string; | ||
converters: { | ||
string( | ||
req: any, | ||
data: any, | ||
name: string, | ||
object: AposObject, | ||
field: any, | ||
callback: () => any | ||
): void; | ||
form( | ||
req: any, | ||
data: any, | ||
name: string, | ||
object: AposObject, | ||
field: any, | ||
callback: () => any | ||
): void; | ||
}; | ||
empty?(field: any, value: any): void; | ||
bless?(req: any, field: any): void; | ||
index(value: any, field: any, texts: any): void; | ||
} | ||
|
||
interface Schema { | ||
createRoutes(): any[]; | ||
pushAssets(): void; | ||
pushCreateSingleton(): void; | ||
compose(options: AposObject): void; | ||
refine(schema: Schema, options: AposObject): void; | ||
toGroups(fields: Fields): void; | ||
subset(schema: Schema, fields: Fields): Schema; | ||
newInstance(schema: Schema): any; | ||
subsetInstance(schema: Schema, instance: AposObject): any; | ||
empty(schema: Schema, object: AposObject): void; | ||
indexFields(schema: Schema, object: AposObject, texts: any): void; | ||
convert( | ||
req: any, | ||
schema: Schema, | ||
to: any, | ||
object: AposObject, | ||
output: any, | ||
callback: () => any | ||
): void; | ||
isVisible(schema: Schema, object: AposObject, name: string): void; | ||
export( | ||
req: any, | ||
schema: Schema, | ||
to: any, | ||
object: AposObject, | ||
output: any, | ||
callback: () => any | ||
): void; | ||
joinDriver( | ||
req: any, | ||
method: any, | ||
reverse: any, | ||
items: any, | ||
idField: any, | ||
relationshipsField: any, | ||
objectField: any, | ||
options: any, | ||
callback: () => any | ||
): void; | ||
join( | ||
req: any, | ||
schema: Schema, | ||
objectOrArray: any, | ||
withJoins: any, | ||
callback: () => any | ||
): void; | ||
addFieldType(type: AposType): void; | ||
getFieldType(typeName: string): void; | ||
addFilters(schema: Schema, options: any, cursor: any): void; | ||
joinFilterChoices(field: any, cursor: any, valueField: any): void; | ||
addJoinSlugFilter(field: any, cursor: any, suffix: any): void; | ||
pageServe(req: any): void; | ||
sortedDistinct(property: any, cursor: any, callback: () => any): void; | ||
cursorFilterInterested(cursor: any, name: string): void; | ||
afterInit(): void; | ||
validate(schema: Schema, options: any): void; | ||
} | ||
|
||
interface AposModule { | ||
emit(name: string): void; | ||
on(name: string, methodName: any, fn: () => any): void; | ||
} | ||
|
||
type AposCoreModules = | ||
| "apostrophe-admin-bar" | ||
| "apostrophe-any-page-manager" | ||
| "apostrophe-areas" | ||
| "apostrophe-assets" | ||
| "apostrophe-attachments" | ||
| "apostrophe-browser-utils" | ||
| "apostrophe-caches" | ||
| "apostrophe-custom-pages" | ||
| "apostrophe-db" | ||
| "apostrophe-doc-type-manager" | ||
| "apostrophe-docs" | ||
| "apostrophe-email" | ||
| "apostrophe-express" | ||
| "apostrophe-files" | ||
| "apostrophe-files-widgets" | ||
| "apostrophe-global" | ||
| "apostrophe-groups" | ||
| "apostrophe-html-widgets" | ||
| "apostrophe-i18n" | ||
| "apostrophe-images" | ||
| "apostrophe-images-widgets" | ||
| "apostrophe-jobs" | ||
| "apostrophe-launder" | ||
| "apostrophe-locks" | ||
| "apostrophe-login" | ||
| "apostrophe-migrations" | ||
| "apostrophe-modal" | ||
| "apostrophe-module" | ||
| "apostrophe-notifications" | ||
| "apostrophe-oembed" | ||
| "apostrophe-pager" | ||
| "apostrophe-pages" | ||
| "apostrophe-permissions" | ||
| "apostrophe-pieces" | ||
| "apostrophe-pieces-pages" | ||
| "apostrophe-pieces-widgets" | ||
| "apostrophe-polymorphic-manager" | ||
| "apostrophe-push" | ||
| "apostrophe-rich-text-widgets" | ||
| "apostrophe-schemas" | ||
| "apostrophe-search" | ||
| "apostrophe-service-bridge" | ||
| "apostrophe-soft-redirects" | ||
| "apostrophe-tags" | ||
| "apostrophe-tasks" | ||
| "apostrophe-templates" | ||
| "apostrophe-ui" | ||
| "apostrophe-urls" | ||
| "apostrophe-users" | ||
| "apostrophe-utils" | ||
| "apostrophe-versions" | ||
| "apostrophe-video-fields" | ||
| "apostrophe-video-widgets" | ||
| "apostrophe-widgets"; | ||
|
||
// Pass in custom modules to AposModuleOptions to allow them in extend | ||
interface AposModuleOptions<C = {}> { | ||
extend: AposCoreModules | C; | ||
name?: string; | ||
label: string; | ||
pluralLabel?: string; | ||
playerData?: false | string[]; | ||
scene?: "user"; | ||
addFields?: Field[]; | ||
removeFields?: Field[]; | ||
arrangeFields?: { | ||
name: string; | ||
label: string; | ||
fields: string[]; | ||
}[]; | ||
defer?: boolean; | ||
filters?: { | ||
projection?: { | ||
[key: string]: number; | ||
}; | ||
}; | ||
} | ||
} |
Oops, something went wrong.