From ce35edc06b1a169f44ee149d04c0c6f4d5b5a6c3 Mon Sep 17 00:00:00 2001 From: David Kirkland Date: Fri, 5 Feb 2016 16:50:46 +0900 Subject: [PATCH 1/5] Added 3 parameters to config interface. --- ckeditor/ckeditor.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index 88fee3674..242486f07 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -566,12 +566,14 @@ declare module CKEDITOR { contentsCss?: string | string[]; contentsLangDirection?: string; customConfig?: string; + enterMode?: number; extraPlugins?: string; font_names?: string; font_defaultLabel?: string; fontSize_sizes?: string; fontSize_defaultLabel?: string; height?: string | number; + htmlEncodeOutput?: boolean; language?: string; on?: any; plugins?: string; @@ -583,6 +585,7 @@ declare module CKEDITOR { toolbarGroups?: toolbarGroups[]; toolbarLocation?: string; readOnly?: boolean; + shiftEnterMode?: number; skin?: string; width?: string | number; } @@ -1147,4 +1150,4 @@ declare module CKEDITOR { function load(languageCode: string, defaultLanguage: string, callback: Function): void; function detect(defaultLanguage: string, probeLanguage: string): string; } -} +} \ No newline at end of file From 88e289dc293019adf73f61bb8876ee69adc3e457 Mon Sep 17 00:00:00 2001 From: David Kirkland Date: Fri, 5 Feb 2016 16:54:19 +0900 Subject: [PATCH 2/5] Added 3 parameters to config interface. --- ckeditor/ckeditor.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index 242486f07..dd61e57d3 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -168,7 +168,7 @@ declare module CKEDITOR { // Properties type: number; - // Methods + // Methods constructor(element: string, ownerDocument?: document); constructor(element: HTMLElement, ownerDocument?: document); addClass(className: string): void; @@ -1150,4 +1150,4 @@ declare module CKEDITOR { function load(languageCode: string, defaultLanguage: string, callback: Function): void; function detect(defaultLanguage: string, probeLanguage: string): string; } -} \ No newline at end of file +} From 3753596225f3bdee43a6299e00a44f84714f9ce9 Mon Sep 17 00:00:00 2001 From: Might-E Date: Fri, 5 Feb 2016 10:44:46 +0100 Subject: [PATCH 3/5] get_childDialog is a function get_childDialog is a function returns SP.UI.ModalDialog --- sharepoint/SharePoint.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharepoint/SharePoint.d.ts b/sharepoint/SharePoint.d.ts index 0cb60b5c6..e1a096084 100644 --- a/sharepoint/SharePoint.d.ts +++ b/sharepoint/SharePoint.d.ts @@ -7329,7 +7329,7 @@ declare module SP { /** Displays a wait/loading modal dialog with the specified title, message, height and width. Height and width are defined in pixels. Cancel button is shown. If user clicks it, the callbackFunc is called. */ static showWaitScreenSize(title: string, message?: string, callbackFunc?: SP.UI.DialogReturnValueCallback, height?: number, width?: number): SP.UI.ModalDialog; static showPlatformFirstRunDialog(url: string, callbackFunc: SP.UI.DialogReturnValueCallback): SP.UI.ModalDialog; - static get_childDialog: ModalDialog; + static get_childDialog(): SP.UI.ModalDialog; /** Closes the dialog using the specified dialog result. */ close(dialogResult: SP.UI.DialogResult): void; } From bb86dc40b90afa291c02614e8899da0ced7b9703 Mon Sep 17 00:00:00 2001 From: "Remo H. Jansen" Date: Fri, 5 Feb 2016 11:12:51 +0000 Subject: [PATCH 4/5] Fixes compilation error The original file contained: ``` /** * A component that renders a React Router app using router state from a Redux store. */ export class ReactRouter { } ``` The exported ``ReactRouter ` class is empty but it is supposed to be the ReactRouter. I removed the empty class and exported the the ReactRouter instead: ``` declare module "redux-router/lib/ReduxRouter" { import Router from "react-router"; export default Router; } ``` --- redux-router/redux-router.d.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/redux-router/redux-router.d.ts b/redux-router/redux-router.d.ts index 3bd7b0e7b..82f4e58d6 100644 --- a/redux-router/redux-router.d.ts +++ b/redux-router/redux-router.d.ts @@ -16,10 +16,6 @@ declare namespace __ReduxRouter { */ export class ReduxRouter extends React.Component { } /** - * A component that renders a React Router app using router state from a Redux store. - */ - export class ReactRouter { } - /** * A Redux store enhancer that adds router state to the store. */ export var reduxReactRouter: any; @@ -46,7 +42,8 @@ declare module "redux-router/lib/routerStateReducer" { } declare module "redux-router/lib/ReduxRouter" { - export default __ReduxRouter.ReactRouter; + import Router from "react-router"; + export default Router; } declare module "redux-router/lib/client" { From 3e7024258a8a47e7c08ad973bd61e07a3a655514 Mon Sep 17 00:00:00 2001 From: Matthew Dahl Date: Fri, 5 Feb 2016 22:18:00 -0800 Subject: [PATCH 5/5] add router5 definition update typings fix typings attribution add tests and cleanup undo attribute change add line back --- router5/router5-tests.ts | 28 +++++++++++++ router5/router5.d.ts | 90 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 router5/router5-tests.ts create mode 100644 router5/router5.d.ts diff --git a/router5/router5-tests.ts b/router5/router5-tests.ts new file mode 100644 index 000000000..bc1bfba9a --- /dev/null +++ b/router5/router5-tests.ts @@ -0,0 +1,28 @@ +/// + +import Router5, {loggerPlugin, RouteNode, Router5 as _Router5} from 'router5'; + +const router1: Router5 = new Router5(); +const router2: Router5 = new _Router5(); + +[router1, router2].forEach(function (router: Router5) { + const settingsNode: RouteNode = new RouteNode('settings', '/settings'); + + router + .setOption('useHash', true) + .setOption('defaultRoute', 'home'); + + router.setAdditionalArgs([]); + + router + .add(settingsNode) + .addNode('home', '/') + .addNode('profile', '/profile', function () { + return false; + }) + .usePlugin(loggerPlugin()) + .useMiddleware(function () {}) + .useMiddleware(function () {}, function () {}) + .start() + .stop(); +}); diff --git a/router5/router5.d.ts b/router5/router5.d.ts new file mode 100644 index 000000000..a15187ac0 --- /dev/null +++ b/router5/router5.d.ts @@ -0,0 +1,90 @@ +// Type definitions for router5 +// Project: https://github.com/router5/router5 +// Definitions by: Matthew Dahl +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'router5' { + interface constants { + ROUTER_NOT_STARTED: String; + ROUTER_ALREADY_STARTED: String; + ROUTE_NOT_FOUND: String; + SAME_STATES: String; + CANNOT_DEACTIVATE: String; + CANNOT_ACTIVATE: String; + TRANSITION_ERR: String; + TRANSITION_CANCELLED: String; + } + + interface State { + _meta: Array; + name: String; + params: Object; + } + + interface RouteNode { + add(route: any, cb?: Function): RouteNode; + addNode(name?: any, params?: any): RouteNode; + buildPath(routeName: String, params?: Object): String; + buildPathFromSegments(segment: Array, params?: Object): String; + buildState(name: String, params?: Object): State; + buildStateFromSegments(segments: Array): State; + getMetaFromSegments(segments: Array): Array; + getPath(routeName: String): String; + getPathFromSegments(segments: Array): String; + getSegmentsByName(routeName: String): Array; + getSegmentsMatchingPath(path: any, options: Object): Array; + matchPath(path: any, options?: Object): State; + setPath(path?: any): void; + } + + interface RouteNodeFactory { + new(name?: any, path?: any, childRoutes?: any, cb?: Function): RouteNode; + (name?: any, path?: any, childRoutes?: any, cb?: Function): RouteNode; + } + + interface Router5 { + add(routes: any): Router5; + addNode(name: String, path: String, canActivate?: Function): Router5; + areStatesDescendants(parentState: any, childState: any): Boolean; + areStatesEqual(state1: any, state2: any): Boolean; + buildPath(route: String, params: Object): String; + buildState(route: String, params: Object): String; + buildUrl(route: String, params: Object): String; + canActivate(name: String, canActivate: Function): Router5; + canDeactivate(name: String, canDeactivate: Boolean): any; + cancel(): void; + getAdditionalArgs(): Array; + getState(): Object; + isActive(name: String, params?: Object, strictEquality?: Boolean, ignoreQueryParams?: Boolean): Boolean; + matchPath(path: String): Object; + matchUrl(url: String): Object; + navigate(name: String, ...args: Array): Function; + setAdditionalArgs(args: Array): void; + setOption(opt: String, val: any): Router5; + start(...args: Array): Router5; + stop(): Router5; + urlToPath(path: String): String; + useMiddleware(...args: Array): Router5; + usePlugin(pluginFactory: Function): Router5; + } + + interface Router5Factory { + new(routes?: any, opts?: Object): Router5; + (routes?: any, opts?: Object): Router5; + } + + var errCodes: constants; + var loggerPlugin: () => Function; + var RouteNode: RouteNodeFactory; + var Router5: Router5Factory; + var transitionPath: (toState: any, fromState: any) => any; + + export default Router5; + export { + errCodes, + loggerPlugin, + RouteNode, + Router5, + transitionPath + }; +}