Fix weak type errors (#16845)

* Fix first round of weak type errors

Done through griddle-react

* 95% done with weak type fixes

* Fix last couple of weak type errors

* Remove some lint from mithril tests

* mithril's Lifecycle is not a weak type any more

Restore the Lifecycle constraints in the rest of the definitions.

* Fix react-redux tests after #16652 broke them

* Remove package-lock.json
This commit is contained in:
Nathan Shively-Sanders 2017-06-04 22:03:03 -07:00 committed by Mohamed Hegazy
parent 08786315ca
commit 163f4438df
49 changed files with 133 additions and 109 deletions

View File

@ -119,7 +119,7 @@ interface ExtendedTestStore extends AltJS.AltStore<AltTestState> {
split():Array<string>;
}
var testStore = <ExtendedTestStore>alt.createStore<AltTestState>(TestStore);
var testStore = <ExtendedTestStore>alt.createStore<AltTestState>(new TestStore());
function testCallback(state:AltTestState) {
console.log(state);

View File

@ -591,7 +591,7 @@ namespace TestPromise {
assertPromiseType<TResult>(promise.catch((err) => anyOf2(tresult, reject)));
assertPromiseType<TResult>(promise.catch((err) => anyOf3(tresult, tresultPromise, reject)));
assertPromiseType<TResult>(promise.catch((err) => tresultPromise));
assertPromiseType<ng.IHttpPromiseCallbackArg<TResult>>(promise.catch((err) => tresultHttpPromise));
assertPromiseType<TResult | ng.IHttpPromiseCallbackArg<TResult>>(promise.catch((err) => tresultHttpPromise));
assertPromiseType<TResult | TOther>(promise.catch((err) => tother));
assertPromiseType<TResult | TOther>(promise.catch((err) => totherPromise));
assertPromiseType<TResult | ng.IHttpPromiseCallbackArg<TOther>>(promise.catch((err) => totherHttpPromise));

View File

@ -15,6 +15,8 @@ class TestController {
storage.clearAll();
}
$onInit() {
}
}
var app = angular.module('angularLocalStorageTests', ['angularLocalStorage']);

View File

@ -107,60 +107,48 @@ namespace Paging {
testCollection.getFirstPage(options);
// 'silent's type is boolean. (structural subtyping)
testCollection.getFirstPage({silent: 'aa'});
// 'url's type is string. (structural subtyping)
testCollection.getFirstPage({url: true});
testCollection.getFirstPage({silent: false});
testCollection.getFirstPage({url: 'zombocom'});
result = testCollection.getLastPage();
testCollection.getLastPage(options);
// 'silent's type is boolean. (structural subtyping)
testCollection.getLastPage({silent: 'aa'});
// 'url's type is string. (structural subtyping)
testCollection.getLastPage({url: true});
testCollection.getLastPage({silent: true});
testCollection.getLastPage({url: 'chickensnack'});
result = testCollection.getNextPage();
testCollection.getNextPage(options);
// 'silent's type is boolean. (structural subtyping)
testCollection.getNextPage({silent: 'aa'});
// 'url's type is string. (structural subtyping)
testCollection.getNextPage({url: true});
testCollection.getNextPage({silent: false});
testCollection.getNextPage({url: 'hampsterdance'});
result = testCollection.getPage(1);
testCollection.getPage("1", options);
// 'silent's type is boolean. (structural subtyping)
testCollection.getPage(1, {silent: 'aa'});
// 'url's type is string. (structural subtyping)
testCollection.getPage(1, {url: true});
testCollection.getPage(1, {silent: true});
testCollection.getPage(1, {url: 'badcandy'});
result = testCollection.getPageByOffset(1);
testCollection.getPageByOffset(1, options);
// 'silent's type is boolean. (structural subtyping)
testCollection.getPageByOffset(1, {silent: 'aa'});
// 'url's type is string. (structural subtyping)
testCollection.getPageByOffset(1, {url: true});
testCollection.getPageByOffset(1, {silent: false});
testCollection.getPageByOffset(1, {url: 'oldmanmurray'});
result = testCollection.getPreviousPage();
testCollection.getPreviousPage(options);
// 'silent's type is boolean. (structural subtyping)
testCollection.getPreviousPage({silent: 'aa'});
// 'url's type is string. (structural subtyping)
testCollection.getPreviousPage({url: true});
testCollection.getPreviousPage({silent: false});
testCollection.getPreviousPage({url: 'uncyclopedia'});
var hasPage:boolean = testCollection.hasNextPage();
@ -231,7 +219,7 @@ namespace Setting {
var result2:TestCollection
= testCollection.setSorting('id', 1, options);
= testCollection.setSorting('id', 1, { full: true});
result1 = testCollection.switchMode(
'server',

View File

@ -40,7 +40,8 @@ declare namespace Bookshelf {
tableName?: string;
}
abstract class ModelBase<T extends Model<any>> extends Events<T | Collection<T>> implements IModelBase {
interface ModelBase<T extends Model<any>> extends IModelBase { }
abstract class ModelBase<T extends Model<any>> extends Events<T | Collection<T>> {
/** If overriding, must use a getter instead of a plain property. */
idAttribute: string;

View File

@ -8,5 +8,5 @@ declare class PostBuffer extends BufferStream {
/** set a callback to get all post data from a http server request */
onEnd(callback: (data: any) => void): void;
/** pumps data into another stream to allow incoming streams given options will be passed to Stream.pipe */
pipe(stream: NodeJS.WritableStream, options?: BufferStream.Opts): NodeJS.ReadableStream;
pipe(stream: NodeJS.WritableStream, options?: { end?: boolean }): NodeJS.ReadableStream;
}

View File

@ -263,13 +263,13 @@ declare namespace Logger {
limit?: number;
}
class RingBuffer extends EventEmitter {
class RingBuffer extends EventEmitter implements NodeJS.WritableStream {
constructor(options: RingBufferOptions);
writable: boolean;
records: any[];
write(record: any): void;
write(record: any): boolean;
end(record?: any): void;
destroy(): void;
destroySoon(): void;

View File

@ -273,7 +273,7 @@ ipcRenderer.on('ping', function() {
// showOpenDialog
// https://electron.atom.io/docs/api/dialog/#dialogshowopendialogbrowserwindow-options-callback
remote.dialog.showOpenDialog(win);
remote.dialog.showOpenDialog({ title: 'foo' });
remote.dialog.showOpenDialog(win, {}, fileNames => fileNames);
remote.dialog.showOpenDialog(win, {
title: 'foo',
@ -293,7 +293,7 @@ remote.dialog.showOpenDialog(win, {
// showSaveDialog
// https://electron.atom.io/docs/api/dialog/#dialogshowsavedialogbrowserwindow-options-callback
remote.dialog.showSaveDialog(win);
remote.dialog.showSaveDialog({ title: 'foo' });
remote.dialog.showSaveDialog(win, {}, fileNames => fileNames);
remote.dialog.showSaveDialog(win, {
title: 'foo',

View File

@ -70,7 +70,7 @@ function ShallowWrapperTest() {
shallowWrapper = shallowWrapper.filter(MyComponent);
statelessWrapper = statelessWrapper.filter(MyStatelessComponent);
shallowWrapper = shallowWrapper.filter({ numberProp: 12 });
elementWrapper = shallowWrapper.filter('.selector');
shallowWrapper = shallowWrapper.filter('.selector');
}
function test_filterWhere() {
@ -422,7 +422,7 @@ function ReactWrapperTest() {
reactWrapper = reactWrapper.filter(MyComponent);
statelessWrapper = statelessWrapper.filter(MyStatelessComponent);
reactWrapper = reactWrapper.filter({ numberProp: 12 });
elementWrapper = reactWrapper.filter('.selector');
reactWrapper = reactWrapper.filter('.selector');
}
function test_filterWhere() {

View File

@ -27,7 +27,7 @@ var options = {
maxLength: 120
}
var result = eyes.inspector(testObj)
var result = eyes.inspector(options)

View File

@ -43,7 +43,7 @@ export interface EyesOptions {
/** Don't output functions at all */
hideFunctions?: boolean;
/** Stream to write to, or null */
stream?: stream.Writable;
stream?: NodeJS.WritableStream;
/** Truncate output if longer */
maxLength?: number;
}

View File

@ -180,17 +180,17 @@ str = fs.readFileSync(filename, encoding);
buf = fs.readFileSync(filename, openOpts);
fs.writeFile(filename, data, errorCallback);
fs.writeFile(filename, data, encoding, errorCallback);
fs.writeFile(filename, data, { encoding }, errorCallback);
fs.writeFile(filename, data, writeOpts, errorCallback);
fs.writeFileSync(filename, data);
fs.writeFileSync(filename, data, encoding);
fs.writeFileSync(filename, data, { encoding });
fs.writeFileSync(filename, data, writeOpts);
fs.appendFile(filename, data, errorCallback);
fs.appendFile(filename, data, encoding, errorCallback);
fs.appendFile(filename, data, { encoding }, errorCallback);
fs.appendFile(filename, data, writeOpts, errorCallback);
fs.appendFileSync(filename, data);
fs.appendFileSync(filename, data, encoding);
fs.appendFileSync(filename, data, { encoding });
fs.appendFileSync(filename, data, writeOpts);
fs.watchFile(filename, watchListener);

View File

@ -62,7 +62,7 @@ fs.copy(src, dest,
);
fs.copySync(src, dest);
fs.copySync(src, dest, (src: string) => false);
fs.copySync(src, dest, /.*/);
fs.copySync(src, dest, { filter: /.*/ });
fs.copySync(src, dest,
{
overwrite: true,

View File

@ -19,19 +19,19 @@ function test_namespace() {
"enumDescriptions" ?: string[];
"location" ?: string;
}
var kBI : AnalyticsParameter = gapi.client.analytics.kB.parameters.alt;
var kBI : AnalyticsParameter = new gapi.client.analytics.kB.parameters.alt();
var kB = !!kBI;
kBI = gapi.client.analytics.kB.parameters.fields;
kBI = new gapi.client.analytics.kB.parameters.fields();
kB = kB && !!kBI;
kBI = gapi.client.analytics.kB.parameters.key;
kBI = new gapi.client.analytics.kB.parameters.key();
kB = kB && !!kBI;
kBI = gapi.client.analytics.kB.parameters.oauth_token;
kBI = new gapi.client.analytics.kB.parameters.oauth_token();
kB = kB && !!kBI;
kBI = gapi.client.analytics.kB.parameters.prettyPrint;
kBI = new gapi.client.analytics.kB.parameters.prettyPrint();
kB = kB && !!kBI;
kBI = gapi.client.analytics.kB.parameters.quotaUser;
kBI = new gapi.client.analytics.kB.parameters.quotaUser();
kB = kB && !!kBI;
kBI = gapi.client.analytics.kB.parameters.userIP;
kBI = new gapi.client.analytics.kB.parameters.userIP();
kB = kB && !!kBI;
analytics = analytics && kB;

View File

@ -47,13 +47,20 @@ declare namespace gapi.client.analytics.kB.parameters {
"enumDescriptions" ?: string[];
"location" ?: string;
}
export class alt implements AnalyticsParameter {}
export class fields implements AnalyticsParameter {}
export class key implements AnalyticsParameter {}
export class oauth_token implements AnalyticsParameter {}
export class prettyPrint implements AnalyticsParameter {}
export class quotaUser implements AnalyticsParameter {}
export class userIP implements AnalyticsParameter {}
export interface alt extends AnalyticsParameter {}
export class alt {}
export interface fields extends AnalyticsParameter {}
export class fields {}
export interface key extends AnalyticsParameter {}
export class key {}
export interface oauth_token extends AnalyticsParameter {}
export class oauth_token {}
export interface prettyPrint extends AnalyticsParameter {}
export class prettyPrint {}
export interface quotaUser extends AnalyticsParameter {}
export class quotaUser {}
export interface userIP extends AnalyticsParameter {}
export class userIP {}
}
interface View {

View File

@ -26,15 +26,15 @@ declare namespace coffeeify {
transforms?: Transforms;
}
interface Aliases {
type Aliases = Array<{
cwd?: string;
base?: string;
}
}>;
interface Transforms {
type Transforms = Array<{
ext?: string;
transform?(data: string): string;
}
}>;
}
declare var coffeeify: coffeeify.Coffeeify;

View File

@ -5012,7 +5012,7 @@ declare namespace Highcharts {
* color: '#FF00FF'
* }]
*/
data?: number[] | Array<[number, number]> | Array<[string, number]> | DataPoint[];
data?: Array<number | [number, number] | [string, number] | DataPoint>;
/**
* An id for the series. This can be used after render time to get a pointer to the series object through
* chart.get().

View File

@ -101,7 +101,7 @@ let iso: Isotope = $grid.data('isotope');
iso = new Isotope('.grid');
iso.addItems($('.items'));
iso.appended(new HTMLElement());
iso.arrange(new HTMLElement());
iso.arrange({ cellsByColumn: { columnWidth: 101, rowHeight: 12 } });
iso.destroy();
elements = iso.getFilteredItemElements();
elements = iso.getItemElements();

View File

@ -30,7 +30,7 @@ User.find(1).then(function (user:IUser) {
var user:IUser = User.createInstance({name: 'John'});
var store = new JSData.DS();
var User2 = store.defineResource('user');
var User2 = store.defineResource<IUser>('user');
var user:IUser = User2.inject({id: 1, name: 'John'});
var user2:IUser = User2.inject({id: 1, age: 30});
@ -601,4 +601,4 @@ customActionResourceInstance.on("DS.change", myEvtHandler);
customActionResourceInstance.off("DS.change", myEvtHandler);
customActionResourceInstance.emit("DS.change", customActionResource, customActionResourceInstance);
JSData.DSUtils.Promise = Promise;
JSData.DSUtils.Promise = Promise;

View File

@ -7,7 +7,8 @@ declare namespace jsyaml {
export function safeLoad(str: string, opts?: LoadOptions): any;
export function load(str: string, opts?: LoadOptions): any;
export class Type implements TypeConstructorOptions {
export interface Type extends TypeConstructorOptions { }
export class Type {
constructor(tag: string, opts?: TypeConstructorOptions);
tag: string;
}

View File

@ -1592,11 +1592,11 @@ declare namespace kendo.ui {
}
interface AlertMessages {
interface AlertMessages extends DialogMessages {
okText?: string;
}
interface AlertOptions {
interface AlertOptions extends DialogOptions {
name?: string;
messages?: AlertMessages;
}
@ -2104,12 +2104,12 @@ declare namespace kendo.ui {
}
interface ConfirmMessages {
interface ConfirmMessages extends DialogMessages {
okText?: string;
cancel?: string;
}
interface ConfirmOptions {
interface ConfirmOptions extends DialogOptions {
name?: string;
messages?: ConfirmMessages;
}
@ -5267,12 +5267,12 @@ declare namespace kendo.ui {
}
interface PromptMessages {
interface PromptMessages extends DialogMessages {
okText?: string;
cancel?: string;
}
interface PromptOptions {
interface PromptOptions extends DialogOptions {
name?: string;
messages?: PromptMessages;
}

View File

@ -513,7 +513,8 @@ declare namespace mapboxgl {
/**
* VideoSource
*/
export class VideoSource implements Source, VideoSourceOptions {
export interface VideoSource extends VideoSourceOptions { }
export class VideoSource implements Source {
type: "video";
constructor(options?: mapboxgl.VideoSourceOptions);
@ -532,7 +533,8 @@ declare namespace mapboxgl {
/**
* ImageSource
*/
export class ImageSource implements Source, ImageSourceOptions {
export interface ImageSource extends ImageSourceOptions { }
export class ImageSource implements Source {
type: "image";
constructor(options?: mapboxgl.ImageSourceOptions);
@ -1038,7 +1040,7 @@ declare namespace mapboxgl {
export interface CirclePaint {
"circle-radius"?: number | StyleFunction;
"circle-radius-transition"?: Transition;
"circle-color"?: number | StyleFunction;
"circle-color"?: string;
"circle-blur"?: number | StyleFunction;
"circle-opacity"?: number | StyleFunction;
"circle-translate"?: number[];

View File

@ -51,7 +51,7 @@ map.on('load', function(){
}
});
var layers = [
var layers: [number, string][] = [
[150, '#f28cb1'],
[20, '#f1f075'],
[0, '#51bbd6']
@ -369,4 +369,4 @@ let marker = new mapboxgl.Marker(null,{offset: [10, 0]})
.setLngLat([-50,50])
.addTo(map);
marker.remove();
marker.remove();

View File

@ -219,6 +219,9 @@ declare namespace MarkItUp {
* Returns true if the Alt key is pressed when the callback is fired.
*/
altKey?: boolean;
/** Not documented on the markitup site, but present in the tests */
separator?: string;
}
interface Static {

View File

@ -317,7 +317,7 @@ declare namespace Materialize {
* It will only be called once.
* Example: 'console.log("hello, world!")';
*/
callback?: Function;
callback?: string;
}
interface TabOptions {
@ -393,7 +393,7 @@ declare namespace Materialize {
*
* @name options optional parameter with scroll fire options
*/
scrollFire(options?: ScrollFireOptions): void;
scrollFire(options?: ScrollFireOptions[]): void;
/**
* A staggered reveal effect for any UL Tag with list items

View File

@ -44,6 +44,7 @@ declare namespace Mithril {
onbeforeupdate?(this: State, vnode: Vnode<Attrs, State>, old: VnodeDOM<Attrs, State>): boolean | void;
/** The onremove hook is called before a DOM element is removed from the document. */
onupdate?(this: State, vnode: VnodeDOM<Attrs, State>): any;
[s: string]: any;
}
interface Hyperscript {

View File

@ -59,7 +59,7 @@ route(document.body, '/', {
return h(component1);
}
},
'test3': {
test3: {
onmatch(args, path) {
return component2;
},
@ -67,7 +67,7 @@ route(document.body, '/', {
return ['abc', 123, null, h(component2), ['nested', h('p', 123)]];
}
},
'test4': {
test4: {
onmatch(args, path) {
// Must provide a Promise type if we want type checking
return new Promise<Component<{title: string}, {}>>((resolve, reject) => {

View File

@ -914,7 +914,8 @@ declare module "mongoose" {
* section document.js
* http://mongoosejs.com/docs/api.html#document-js
*/
class MongooseDocument implements MongooseDocumentOptionals {
interface MongooseDocument extends MongooseDocumentOptionals { }
class MongooseDocument {
/** Checks if a path is set to its default. */
$isDefault(path?: string): boolean;

View File

@ -1,4 +1,4 @@
class NgMapTestController {
class NgMapTestController implements ng.IController {
constructor(public $scope: ng.IScope, public $window: ng.IWindowService, public NgMap: angular.map.INgMap) {
this.showMap();
}
@ -8,6 +8,8 @@ class NgMapTestController {
console.log(map.getCenter());
});
}
$onInit() {
}
}
var app = angular.module('angularLocalStorageTests', ['ngMap']);
@ -21,4 +23,4 @@ app.config(function(NgMapProvider: angular.map.INgMapProvider) {
});
app.controller('testCtrl', ['$scope', '$window', 'ngMap',
($scope: ng.IScope, $window: ng.IWindowService, NgMap: angular.map.INgMap) => new NgMapTestController($scope, $window, NgMap)]);
($scope: ng.IScope, $window: ng.IWindowService, NgMap: angular.map.INgMap) => new NgMapTestController($scope, $window, NgMap)]);

View File

@ -40,6 +40,13 @@ declare namespace PDK {
session?: OauthSession;
}
interface PinData {
board: string;
note: string;
link: string;
image_url: string;
}
/**
* Get information on the currently authenticated user
* @param cb the callback export function to handle the response
@ -69,7 +76,7 @@ declare namespace PDK {
* @param path URL path
* @param httpMethod HTTP verb
*/
export function request(path: string, httpMethod?: string|HttpMethod, params?: OAuthRequestParams, callback?: Function): void;
export function request(path: string, httpMethod?: string|HttpMethod, data?: PinData, callback?: Function): void;
/**
* Show user login dialog, and save access token

View File

@ -105,7 +105,8 @@ declare namespace polymer {
computed?: string;
observer?: string;
}
class Base extends polymer.PolymerBase implements polymer.Element {
interface Base extends polymer.Element { }
class Base extends polymer.PolymerBase {
static create<T extends polymer.Base>(...args: any[]): T;
static register(): void;
is: string;

View File

@ -228,7 +228,7 @@ export class Marker<P extends MarkerProps, E extends Leaflet.Marker> extends Map
getChildContext(): { popupContainer: E };
}
export interface PathProps extends PathEvents, Leaflet.PathOptions { }
export interface PathProps extends PathEvents, Leaflet.PathOptions, MapLayerProps { }
export abstract class Path<P extends PathProps, E> extends MapLayer<P, E> {
getChildContext(): { popupContainer: E };
getPathOptions(props: P): Leaflet.PathOptions;

View File

@ -11,7 +11,7 @@ export = __ReactMDL;
declare namespace __ReactMDL {
type __MDLClassProps = React.ClassAttributes<any>;
type __MDLOtherProps = React.HTMLProps<any>;
class __MDLComponent<P extends __MDLClassProps> extends React.Component<P, {}> { }
class __MDLComponent<P> extends React.Component<P, {}> { }
class __MDLBasicComponent extends __MDLComponent<__MDLOtherProps> { }
interface ShadowedComponent {

View File

@ -4494,6 +4494,7 @@ export interface SceneConfig {
export interface JumpSceneConfig extends SceneConfig {
gestures: {
pop?: LeftToRightGesture
jumpBack: JumpGesture
jumpForward: JumpGesture
}

View File

@ -2,4 +2,4 @@
"dependencies": {
"redux": "^3.6.0"
}
}
}

View File

@ -370,13 +370,13 @@ namespace TestTOwnPropsInference {
// React.createElement(ConnectedWithoutOwnProps, { anything: 'goes!' });
// This compiles, as expected.
React.createElement(ConnectedWithOwnProps, { own: 'string' });
React.createElement(ConnectedWithOwnProps, { state: 'string', own: 'string' });
// This should not compile, which is good.
// React.createElement(ConnectedWithOwnProps, { anything: 'goes!' });
// This compiles, as expected.
React.createElement(ConnectedWithTypeHint, { own: 'string' });
React.createElement(ConnectedWithTypeHint, { state: 'string', own: 'string' });
// This should not compile, which is good.
// React.createElement(ConnectedWithTypeHint, { anything: 'goes!' });

View File

@ -264,7 +264,7 @@ declare namespace React {
}
interface Mixin<P, S> extends ComponentLifecycle<P, S> {
mixins?: Mixin<P, S>;
mixins?: Mixin<P, S>[];
statics?: {
[key: string]: any;
};

View File

@ -87,7 +87,7 @@ function testDefaultProps() {
const innerComponent = ({a, b}: Props) => <div>{a}, {b}</div>;
const enhancer = defaultProps({ a: "answer", b: 42 });
const enhanced: React.StatelessComponent<Props> = enhancer(innerComponent);
const enhanced: React.StatelessComponent<Props> = enhancer<Props, ({a, b}: Props) => JSX.Element>(innerComponent);
}
function testRenameProp() {

View File

@ -32,7 +32,7 @@ function subscribe_to_topics(session: autobahn.Session, options: autobahn.ISubsc
}
function new_in_version3(onResult: Rx.Observer<autobahn.ISubscription>) {
Rx.Observable.subscribeAsObservable(Rx.Observable.fromConnection("ws://myconnectionurl:9090"), "wamp.my.foo", onResult);
Rx.Observable.subscribeAsObservable(Rx.Observable.fromConnection("ws://myconnectionurl:9090"), "wamp.my.foo", undefined, onResult);
}
function new_in_version5(fooObserver: Rx.Observer<IWampEvent>) {
@ -184,4 +184,4 @@ function weather_station_monitor(session: autobahn.Session) {
// => (2 + 3) * (3 + 4) = 35
console.log("Result was %d", value);
});
}
}

View File

@ -29,7 +29,7 @@ declare namespace Upload {
tmpDir?: string;
workers?: number;
url?: string;
versions?: S3UploaderVersion;
versions?: S3UploaderVersion[];
}
interface Meta {

View File

@ -3171,6 +3171,8 @@ declare namespace sequelize {
* be returned. Only applies if `options.paranoid` is true for the model.
*/
paranoid?: boolean;
all?: boolean | string;
}
/**

View File

@ -923,7 +923,6 @@ User.findOne( { where : { id : 1 }, attributes : ['id', ['username', 'name']] }
User.findOne( { where : { id : 1 }, attributes : ['id'] } );
User.findOne( { where : { username : 'foo' }, logging : function( ) { } } );
User.findOne( { limit : 10 } );
User.findOne( { include : [1] } );
User.findOne( { where : { title : 'homework' }, include : [User] } );
User.findOne( { where : { name : 'environment' }, include : [{ model : User, as : 'PrivateDomain' }] } );
User.findOne( { where : { username : 'foo' }, transaction : t } ).then( ( p ) => p );

View File

@ -658,7 +658,11 @@ namespace CSR {
}
export function getFieldTemplate(field: SPClientTemplates.FieldSchema, mode: SPClientTemplates.ClientControlMode): SPClientTemplates.FieldCallback {
const ctx = { ListSchema: { Field: [field] }, FieldControlModes: {} };
const ctx = {
ListTemplateType: 1,
FieldControlModes: {},
ListSchema: { Field: [field] },
};
ctx.FieldControlModes[field.Name] = mode;
const templates = SPClientTemplates.TemplateManager.GetTemplates(ctx);
return templates.Fields[field.Name];
@ -2332,7 +2336,7 @@ namespace App {
activate(): void;
}
class appcontroller implements Iappcontroller {
class appcontroller implements Iappcontroller, ng.IController {
title: string = "appcontroller";
lists: SP.List[];
@ -2350,9 +2354,12 @@ namespace App {
.catch((e: string) => this.$n.show(e, true))
.finally(() => this.$n.remove(loading));
}
$onInit() {
}
}
angular.module("app").controller("appcontroller", appcontroller);
angular.module("app").controller("appcontroller", [appcontroller]);
}
namespace App {

View File

@ -101,7 +101,7 @@ sortable ? console.log("It's sortable!") : console.log("It's not sortable!");
var data2 = grid.getColumns();
data2[0].name = "First";
grid.setColumns(data);
grid.setColumns(data2);
grid.updateColumnHeader("FirstName", "A First Name");
@ -120,14 +120,14 @@ grid.canCellBeActive(5, 10);
grid.canCellBeSelected(5, 10);
grid.editActiveCell(new Slick.Editors.Date<MyData>({
column: cols,
column: cols[0],
container: undefined,
grid: grid
}));
grid.setActiveCell(0, 0);
grid.editActiveCell(new Slick.Editors.Date<MyData>({
column: cols,
column: cols[0],
container: undefined,
grid: grid
}));

View File

@ -34,6 +34,6 @@
grid = new Slick.Grid("#myGrid", data, columns, options);
grid.setSelectionModel(new Slick.RowSelectionModel({ selectActiveRow: false }));
grid.registerPlugin(checkboxSelector);
var columnpicker = new Slick.Controls.ColumnPicker(columns, grid, options);
var columnpicker = new Slick.Controls.ColumnPicker(columns, grid, { fadeSpeed: 1 });
})
})();
})();

View File

@ -174,7 +174,7 @@ declare namespace UglifyJS {
/**
* Output a source map
*/
source_map?: SourceMapOptions;
source_map?: SourceMap;
/**
* Use brackets every time?

View File

@ -23,8 +23,7 @@ declare namespace paths {
}
interface Callback {
//TODO: Function is gulp.ITaskCallback, which is currently invisible
(path: string, callback: Function): any;
(path: string): any;
}
}

View File

@ -15,7 +15,7 @@ gulp.task('delete2', function (cb: Function) {
.pipe(vp)
.pipe(gulp.dest('dist'))
.on('end', function () {
del(vp.paths, cb);
del(vp.paths);
});
});

View File

@ -19,7 +19,7 @@ class BasicTest {
this.graphComponent.inputMode = graphEditorInputMode;
this.graphComponent.graph.nodeDefaults.style = new yfiles.styles.ShinyPlateNodeStyle(yfiles.view.Fill.ORANGE);
this.graphComponent.graph.nodeDefaults.style = new yfiles.styles.ShinyPlateNodeStyle({ fill: yfiles.view.Fill.ORANGE });
this.graphComponent.graph.createNode(new yfiles.geometry.Rect(0, 0, 10, 10), new MyNodeStyle());