Skip to content

Commit

Permalink
Merge pull request #5 from DefinitelyTyped/master
Browse files Browse the repository at this point in the history
keep fork up to date
  • Loading branch information
nkappler committed Nov 8, 2018
2 parents c98ddc0 + 26d2add commit c17a0c3
Show file tree
Hide file tree
Showing 311 changed files with 11,765 additions and 2,285 deletions.
560 changes: 389 additions & 171 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions notNeededPackages.json
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@
"sourceRepoURL": "https://github.com/code-chris/extended-listbox",
"asOfVersion": "4.0.1"
},
{
"libraryName": "fast-diff",
"typingsPackageName": "fast-diff",
"sourceRepoURL": "https://github.com/jhchen/fast-diff",
"asOfVersion": "1.2.0"
},
{
"libraryName": "JSON-Patch",
"typingsPackageName": "fast-json-patch",
Expand Down Expand Up @@ -978,6 +984,12 @@
"sourceRepoURL": "https://github.com/mweststrate/mobservable-react",
"asOfVersion": "1.0.0"
},
{
"libraryName": "Mobx Cookie",
"typingsPackageName": "mobx-cookie",
"sourceRepoURL": "https://github.com/will-stone/mobx-cookie",
"asOfVersion": "1.1.0"
},
{
"libraryName": "Moment",
"typingsPackageName": "moment",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module('promise-tracker-tests', []).run(['$q', 'promiseTracker',
($q: angular.IQService, promiseTracker: angular.promisetracker.PromiseTrackerService) => {
angular.module('promise-tracker-tests', []).run(['$q', '$http', 'promiseTracker',
($q: angular.IQService, $http: angular.IHttpService, promiseTracker: angular.promisetracker.PromiseTrackerService) => {
const trackerWithoutOptions = promiseTracker();

const options = {
Expand All @@ -19,4 +19,8 @@ angular.module('promise-tracker-tests', []).run(['$q', 'promiseTracker',
const addedPromise: angular.IDeferred<void> = trackerWithOptions.addPromise(promiseToAdd);

const trackerWithSomeOptions = promiseTracker({activationDelay: 500});

$http.post('/foo', {}, { });
$http.post('/foo', {}, { tracker: trackerWithOptions });
$http.post('/foo', {}, { tracker: [trackerWithoutOptions, trackerWithOptions] });
}]);
4 changes: 4 additions & 0 deletions types/angular-promise-tracker/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ declare module 'angular' {
(options?: PromiseTrackerOptions): PromiseTracker;
}
}

interface IRequestShortcutConfig {
tracker?: angular.promisetracker.PromiseTracker | angular.promisetracker.PromiseTracker[];
}
}
5 changes: 4 additions & 1 deletion types/angular-toastr/angular-toastr-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ angular
closeButton: false,
closeHtml: '<button>&times;</button>',
extendedTimeOut: 1000,
extraData: {
txt: "sample text",
action: () => {/* Do action */},
},
iconClasses: {
error: 'toast-error',
info: 'toast-info',
Expand All @@ -29,7 +33,6 @@ angular
progressBar: false,
tapToDismiss: true,
templates: {

toast: 'directives/toast/toast.html',
progressbar: 'directives/progressbar/progressbar.html'
},
Expand Down
1 change: 1 addition & 0 deletions types/angular-toastr/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ declare module 'angular' {
closeButton?: boolean;
closeHtml?: string;
extendedTimeOut?: number;
extraData?: any,
messageClass?: string;
onHidden?: (wasClicked: boolean, toast: angular.toastr.IToast) => void;
onShown?: (toast: angular.toastr.IToast) => void;
Expand Down
2 changes: 1 addition & 1 deletion types/angular-wizard/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Project: https://github.com/mgonto/angular-wizard
// Definitions by: Marko Jurisic <https://github.com/mjurisic>, Ronald Wildenberg <https://github.com/rwwilden>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 2.8

import * as angular from 'angular';

Expand Down
10 changes: 9 additions & 1 deletion types/ansi/ansi-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,13 @@ Object.keys({
, brightCyan: 96
, brightWhite: 97
}).forEach((color) => {
cursor[color]().bold().write(`Hello, bold ${color.replace(/([a-z])([A-Z])/g, (_: string, l: string, u: string): string => `${l} ${u.toLowerCase()}`)} world!\n`).reset();
const cname = color.replace(/([a-z])([A-Z])/g, (_: string, l: string, u: string): string => `${l} ${u.toLowerCase()}`);

((<(...anything: any[]) => ansi.Cursor> cursor[color])()
.bold()
.bg)[color === 'blue' || color === 'brightBlue' ? 'black' : 'blue']()
.write(
`Hello, bold ${cname} world!\n`
)
.reset();
});
19 changes: 16 additions & 3 deletions types/ansi/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Project: https://www.npmjs.com/package/ansi
// Definitions by: Gustavo6046 <https://github.com/Gustavo6046>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1

/**
* References:
Expand All @@ -14,11 +15,19 @@
/// <reference types="node" />
import { Stream } from "stream";

declare function ansi(stream: Stream, options?: any): ansi.Cursor;
interface CursorOptions {
enabled: boolean;
buffering: boolean;
}

declare function ansi(stream: Stream, options?: CursorOptions): ansi.Cursor;

declare namespace ansi {
class Cursor {
constructor(stream: Stream, options?: any);
bg: Colorer;
fg: Colorer;

constructor(stream: Stream, options?: CursorOptions);

/**
* Helper function that calls `write()` on the underlying Stream.
Expand Down Expand Up @@ -161,7 +170,11 @@ declare namespace ansi {
}

interface Cursor {
[key: string]: (...anything: any[]) => Cursor;
[key: string]: ((...anything: any[]) => Cursor) | Colorer;
}

interface Colorer {
[key: string]: (...anything: any[]) => (Cursor | Colorer);
}
}

Expand Down
75 changes: 75 additions & 0 deletions types/arangodb/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,81 @@ declare module "@arangodb/foxx/router" {
export = createRouter;
}

declare module "@arangodb/foxx/queues" {
interface QueueItem {
name: string;
mount: string;
backOff?: ((failureCount: number) => number) | number;
maxFailures?: number;
schema?: Foxx.Schema;
preprocess?: (data: any) => any;
}

interface Script {
name: string;
mount: string;
}

type JobCallback = (result: any, jobData: any, job: ArangoDB.Document<Job>) => void;

interface Job {
status: string;
queue: string;
type: Script;
failures: object[];
runs: number;
data: any;
created: number;
modified: number;
delayUntil: number;
maxFailures: number;
repeatDelay: number;
repeatTimes: number;
repeatUntil: number;
success?: string;
failure?: string;
runFailures: number;
abort(): void;
}

interface JobOptions {
success?: JobCallback;
failure?: JobCallback;
delayUntil?: number | Date;
backOff?: ((failureCount: number) => number) | number;
maxFailures?: number;
repeatTimes?: number;
repeatUntil?: number | Date;
repeatDelay?: number;
}

interface Queue {
push(item: QueueItem, data: any, opts?: JobOptions): void;
get(jobId: string): ArangoDB.Document<Job>;
delete(jobId: string): boolean;
pending(script?: Script): string[];
progress(script?: Script): string[];
complete(script?: Script): string[];
failed(script?: Script): string[];
all(script?: Script): string[];
}

function createQueue(name: string, maxWorkers?: number): Queue;
function deleteQueue(name: string): boolean;
function get(name: string): Queue;

export {
createQueue as create,
deleteQueue as delete,
get,
JobOptions,
Job,
Queue,
QueueItem,
Script,
};
}

declare module "@arangodb/foxx/graphql" {
import { formatError, GraphQLSchema } from "graphql";
type GraphQLModule = object;
Expand Down
1 change: 1 addition & 0 deletions types/autoprefixer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Project: https://github.com/postcss/autoprefixer
// Definitions by: Armando Meziat <https://github.com/odnamrataizem>, murt <https://github.com/murt>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2

import { Plugin } from "postcss";

Expand Down
1 change: 1 addition & 0 deletions types/babylon/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export type PluginName =
'estree' |
'jsx' |
'flow' |
'typescript' |
'classConstructorCall' |
'doExpressions' |
'objectRestSpread' |
Expand Down
4 changes: 4 additions & 0 deletions types/chai-jquery/chai-jquery-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ function test_disabled() {
expect($('#foo')).to.be.disabled;
}

function test_enabled() {
expect($('#foo')).to.be.enabled;
}

function test_empty() {
$('.empty').should.be.empty;
expect($('body')).not.to.be.empty;
Expand Down
1 change: 1 addition & 0 deletions types/chai-jquery/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ declare namespace Chai {
selected(): Assertion;
checked(): Assertion;
disabled(): Assertion;
enabled(): Assertion;
(selector: string): Assertion;
}

Expand Down
3 changes: 3 additions & 0 deletions types/ckeditor/ckeditor-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,9 @@ function test_skin() {
CKEDITOR.skin.loadPart('part', () => console.log('load'));

var path2: string = CKEDITOR.skin.path();

CKEDITOR.skin.ua_dialog = 'ie,iequirks,ie8,gecko';
CKEDITOR.skin.ua_editor = 'ie,gecko';
}

function test_style() {
Expand Down
3 changes: 3 additions & 0 deletions types/ckeditor/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Project: https://ckeditor.com/ckeditor-4/
// Definitions by: Thomas Wittwer <https://github.com/wittwert>
// Stuart Long <https://github.com/stuartlong>
// Viktor Pegy <https://github.com/viktorpegy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

// WORK-IN-PROGRESS: Any contribution support welcomed.
Expand Down Expand Up @@ -2168,6 +2169,8 @@ declare namespace CKEDITOR {
// tslint:disable-next-line:no-duplicate-variable
var name: string;
var ua: { [name: string]: any };
var ua_dialog: string;
var ua_editor: string;

function addIcon(name: string, path: string, offset?: number, bgsize?: string): void;
function chameleon(editor: string, part: string): void;
Expand Down
47 changes: 47 additions & 0 deletions types/codemirror/codemirror-comment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Type definitions for CodeMirror
// Project: https://github.com/marijnh/CodeMirror
// Definitions by: Nikolaj Kappler <https://github.com/nkappler>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

// See docs https://codemirror.net/doc/manual.html#addon_comment

// Todo: add 'toggleComment' command, once command type definitions exist in main definitions

import * as CodeMirror from "codemirror";

declare module "codemirror" {

interface Editor {
/** Tries to uncomment the current selection, and if that fails, line-comments it. */
toggleComment(from: Position, to: Position, options?: CommentOptions): void;
/** Set the lines in the given range to be line comments. Will fall back to `blockComment` when no line comment style is defined for the mode. */
lineComment(from: Position, to: Position, options?: CommentOptions): void;
/** Wrap the code in the given range in a block comment. Will fall back to `lineComment` when no block comment style is defined for the mode. */
blockComment(from: Position, to: Position, options?: CommentOptions): void;
/** Try to uncomment the given range. Returns `true` if a comment range was found and removed, `false` otherwise. */
uncomment(from: Position, to: Position, options?: CommentOptions): boolean;
}

interface CommentOptions {
/** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */
blockCommentStart?: string;
/** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */
blockCommentEnd?: string;
/** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */
blockCommentLead?: string;
/** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */
lineComment?: string;
/** A string that will be inserted after opening and leading markers, and before closing comment markers. Defaults to a single space. */
padding?: string;
/** Whether, when adding line comments, to also comment lines that contain only whitespace. */
commentBlankLines?: boolean;
/** When adding line comments and this is turned on, it will align the comment block to the current indentation of the first line of the block. */
indent?: boolean;
/** When block commenting, this controls whether the whole lines are indented, or only the precise range that is given. Defaults to `true`. */
fullLines?: boolean;
}
}

declare module "codemirror/addon/comment/comment" {
export = CodeMirror;
}
20 changes: 20 additions & 0 deletions types/codemirror/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// nrbernard <https://github.com/nrbernard>
// Pr1st0n <https://github.com/Pr1st0n>
// rileymiller <https://github.com/rileymiller>
// toddself <https://github.com/toddself>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export = CodeMirror;
Expand Down Expand Up @@ -706,8 +707,27 @@ declare namespace CodeMirror {
or undefined if the marker is no longer in the document. */
find(): {from: CodeMirror.Position, to: CodeMirror.Position};

/** Called when you've done something that might change the size of the marker and want to cheaply update the display*/
changed(): void;

/** Returns an object representing the options for the marker. If copyWidget is given true, it will clone the value of the replacedWith option, if any. */
getOptions(copyWidget: boolean): CodeMirror.TextMarkerOptions;

/** Fired when the cursor enters the marked range */
on(eventName: 'beforeCursorEnter', handler: () => void) : void;
off(eventName: 'beforeCursorEnter', handler: () => void) : void;

/** Fired when the range is cleared, either through cursor movement in combination with clearOnEnter or through a call to its clear() method */
on(eventName: 'clear', handler: (from: Position, to: Position) => void) : void;
off(eventName: 'clear', handler: () => void) : void;

/** Fired when the last part of the marker is removed from the document by editing operations */
on(eventName: 'hide', handler: () => void) : void;
off(eventname: 'hide', handler: () => void) : void;

/** Fired when, after the marker was removed by editing, a undo operation brough the marker back */
on(eventName: 'unhide', handler: () => void) : void;
off(eventname: 'unhide', handler: () => void) : void;
}

interface LineWidget {
Expand Down
16 changes: 16 additions & 0 deletions types/codemirror/test/comment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const editor = CodeMirror(document.body);
const position: CodeMirror.Position = { ch: 0, line: 0 };
const opt: CodeMirror.CommentOptions = {
blockCommentEnd: "*/",
blockCommentStart: "/*",
blockCommentLead: "*",
commentBlankLines: true,
fullLines: true,
indent: true,
lineComment: "//",
padding: " "
};
editor.toggleComment(position, position, opt);
editor.blockComment(position, position, opt);
editor.lineComment(position, position, opt);
const b: boolean = editor.uncomment(position, position, opt);
Loading

0 comments on commit c17a0c3

Please sign in to comment.