Skip to content

Commit

Permalink
Merge pull request #5 from DefinitelyTyped/master
Browse files Browse the repository at this point in the history
Updating my own fork
  • Loading branch information
Michelle Scharlock committed Sep 27, 2018
2 parents c25ed38 + bb9a6fd commit 1190547
Show file tree
Hide file tree
Showing 837 changed files with 49,141 additions and 19,582 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[{*.json,*.yml}]
[{*.json,*.yml,*.ts}]
indent_style = space
9,821 changes: 4,952 additions & 4,869 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions notNeededPackages.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@
"sourceRepoURL": "https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions",
"asOfVersion": "2.0.15"
},
{
"libraryName": "bitwise",
"typingsPackageName": "bitwise",
"sourceRepoURL": "https://github.com/dodekeract/bitwise",
"asOfVersion": "2.0.0"
},
{
"libraryName": "botvs",
"typingsPackageName": "botvs",
Expand Down
6 changes: 6 additions & 0 deletions types/ajv-errors/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"ajv": "*"
}
}
9 changes: 4 additions & 5 deletions types/angular-ui-sortable/angular-ui-sortable-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@ myApp.controller('sortableController', function ($scope: MySortableControllerSco
$scope.sortableOptions.tolerance = 'pointer';
$scope.sortableOptions.zIndex = 9999;

$scope.sortableOptions['ui-floating'] = undefined;
$scope.sortableOptions['ui-floating'] = null;
$scope.sortableOptions['ui-floating'] = false;
$scope.sortableOptions['ui-floating'] = true;
$scope.sortableOptions['ui-floating'] = "auto";
const sortableFloatingOption0: ng.ui.UISortableOptions<SortableModelInfo> = { 'ui-floating': undefined };
const sortableFloatingOption1: ng.ui.UISortableOptions<SortableModelInfo> = { 'ui-floating': false };
const sortableFloatingOption2: ng.ui.UISortableOptions<SortableModelInfo> = { 'ui-floating': true };
const sortableFloatingOption3: ng.ui.UISortableOptions<SortableModelInfo> = { 'ui-floating': 'auto' };
});
2 changes: 1 addition & 1 deletion types/angular-ui-sortable/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare module 'angular' {
export namespace ui {

interface UISortableOptions<T> extends SortableOptions<T> {
'ui-floating'?: string | boolean;
'ui-floating'?: 'auto' | boolean;
}

interface UISortableProperties<T> {
Expand Down
2 changes: 1 addition & 1 deletion types/angular/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ declare namespace angular {
*
* @param key the key of the data to be retrieved
*/
get<T>(key: string): T;
get<T>(key: string): T | undefined;

/**
* Removes an entry from the Cache object.
Expand Down
27 changes: 27 additions & 0 deletions types/apostrophe/apostrophe-tests.ts
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"
}
]
};
300 changes: 300 additions & 0 deletions types/apostrophe/index.d.ts
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;
};
};
}
}
Loading

0 comments on commit 1190547

Please sign in to comment.