Fixed the React.addons.update typing to work with TS1.6's new stricter types.

This commit is contained in:
Dave Keen
2015-09-28 16:38:38 +02:00
parent 6f6e5c7dd9
commit f03129f8fa
2 changed files with 19 additions and 9 deletions
+9 -4
View File
@@ -85,14 +85,19 @@ declare namespace __React {
// Reat.addons.update
// ----------------------------------------------------------------------
interface UpdateSpec {
interface UpdateSpecCommand {
$set?: any;
$merge?: {};
$apply?(value: any): any;
// [key: string]: UpdateSpec;
}
interface UpdateArraySpec extends UpdateSpec {
interface UpdateSpecPath {
[key: string]: UpdateSpec;
}
type UpdateSpec = UpdateSpecCommand | UpdateSpecPath;
interface UpdateArraySpec extends UpdateSpecCommand {
$push?: any[];
$unshift?: any[];
$splice?: any[][];
+10 -5
View File
@@ -1668,15 +1668,20 @@ declare module "react/addons" {
//
// Reat.addons.update
// ----------------------------------------------------------------------
interface UpdateSpec {
interface UpdateSpecCommand {
$set?: any;
$merge?: {};
$apply?(value: any): any;
// [key: string]: UpdateSpec;
}
interface UpdateArraySpec extends UpdateSpec {
interface UpdateSpecPath {
[key: string]: UpdateSpec;
}
type UpdateSpec = UpdateSpecCommand | UpdateSpecPath;
interface UpdateArraySpec extends UpdateSpecCommand {
$push?: any[];
$unshift?: any[];
$splice?: any[][];