diff --git a/react/react-global.d.ts b/react/react-global.d.ts index 99fba1e3de..3141d2f87b 100644 --- a/react/react-global.d.ts +++ b/react/react-global.d.ts @@ -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[][]; diff --git a/react/react.d.ts b/react/react.d.ts index f2f4bc0e6b..3ccd648a4d 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -1690,15 +1690,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[][];