diff --git a/src/api/action.ts b/src/api/action.ts index cc5a4ed57..708b52be1 100644 --- a/src/api/action.ts +++ b/src/api/action.ts @@ -33,13 +33,13 @@ export interface IActionFactory { (name: string, fn: T): T & IAction // named decorator - (customName: string): (target: Object, key: string, baseDescriptor?: PropertyDescriptor) => void + (customName: string): (target: Object, key: string | symbol, baseDescriptor?: PropertyDescriptor) => void // unnamed decorator - (target: Object, propertyKey: string, descriptor?: PropertyDescriptor): void + (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor): void // @action.bound decorator - bound(target: Object, propertyKey: string, descriptor?: PropertyDescriptor): void + bound(target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor): void } export var action: IActionFactory = function action(arg1, arg2?, arg3?, arg4?): any { diff --git a/src/api/observabledecorator.ts b/src/api/observabledecorator.ts index e01671416..2cb6c203e 100644 --- a/src/api/observabledecorator.ts +++ b/src/api/observabledecorator.ts @@ -4,7 +4,7 @@ import { IEnhancer } from "../types/modifiers" import { createPropDecorator, BabelDescriptor } from "../utils/decorators2" export type IObservableDecorator = { - (target: Object, property: string, descriptor?: PropertyDescriptor): void + (target: Object, property: string | symbol, descriptor?: PropertyDescriptor): void enhancer: IEnhancer } diff --git a/test/base/decorate.js b/test/base/decorate.js index 8fec69602..7aea6fe64 100644 --- a/test/base/decorate.js +++ b/test/base/decorate.js @@ -50,7 +50,7 @@ test("decorate should work", function() { } decorate(Box, { - uninitialized: observable, + uninitialized: observable.ref, undeclared: observable, height: observable, sizes: observable, @@ -97,6 +97,7 @@ test("decorate should work", function() { test("decorate should work with plain object", function() { const box = { + /** @type {boolean | undefined} */ uninitialized: undefined, height: 20, sizes: [2],