Add @operator.binary, @operator.prefix, @operator.postfix decorators for #124

This commit is contained in:
dcodeIO
2018-06-01 14:17:27 +02:00
parent 9d25f78fc1
commit f69bccfe09
10 changed files with 218 additions and 127 deletions

10
std/assembly.d.ts vendored
View File

@ -573,8 +573,16 @@ declare const Mathf: IMath<f32>;
/** Annotates an element as a program global. */
declare function global(target: Function, propertyKey: string, descriptor: any): void;
/** Annotates a method as an operator overload for the specified `token`. */
/** Annotates a method as a binary operator overload for the specified `token`. */
declare function operator(token: string): (target: any, propertyKey: string, descriptor: any) => void;
declare namespace operator {
/** Annotates a method as a binary operator overload for the specified `token`. */
export function binary(token: string): (target: any, propertyKey: string, descriptor: any) => void;
/** Annotates a method as an unary prefix operator overload for the specified `token`. */
export function prefix(token: string): (target: any, propertyKey: string, descriptor: any) => void;
/** Annotates a method as an unary postfix operator overload for the specified `token`. */
export function postfix(token: string): (target: any, propertyKey: string, descriptor: any) => void;
}
/** Annotates a class as being unmanaged with limited capabilities. */
declare function unmanaged(target: Function): any;