mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-13 23:11:41 +00:00
Improve operator overload typings (#480)
This commit is contained in:
14
std/assembly/index.d.ts
vendored
14
std/assembly/index.d.ts
vendored
@ -931,7 +931,10 @@ declare function global(
|
||||
): TypedPropertyDescriptor<any> | void;
|
||||
|
||||
/** Annotates a method as a binary operator overload for the specified `token`. */
|
||||
declare function operator(token: string): (
|
||||
declare function operator(token:
|
||||
"[]" | "[]=" | "{}" | "{}=" | "==" | "!=" | ">" | "<" | "<=" | ">=" |
|
||||
">>" | ">>>" | "<<" | "&" | "|" | "^" | "+" | "-" | "*" | "**" | "/" | "%"
|
||||
): (
|
||||
target: any,
|
||||
propertyKey: string,
|
||||
descriptor: TypedPropertyDescriptor<any>
|
||||
@ -939,19 +942,22 @@ declare function operator(token: string): (
|
||||
|
||||
declare namespace operator {
|
||||
/** Annotates a method as a binary operator overload for the specified `token`. */
|
||||
export function binary(token: string): (
|
||||
export function binary(token:
|
||||
"[]" | "[]=" | "{}" | "{}=" | "==" | "!=" | ">" | "<" | "<=" | ">=" |
|
||||
">>" | ">>>" | "<<" | "&" | "|" | "^" | "+" | "-" | "*" | "**" | "/" | "%"
|
||||
): (
|
||||
target: any,
|
||||
propertyKey: string,
|
||||
descriptor: TypedPropertyDescriptor<any>
|
||||
) => TypedPropertyDescriptor<any> | void;
|
||||
/** Annotates a method as an unary prefix operator overload for the specified `token`. */
|
||||
export function prefix(token: string): (
|
||||
export function prefix(token: "!" | "~" | "+" | "-" | "++" | "--"): (
|
||||
target: any,
|
||||
propertyKey: string,
|
||||
descriptor: TypedPropertyDescriptor<any>
|
||||
) => TypedPropertyDescriptor<any> | void;
|
||||
/** Annotates a method as an unary postfix operator overload for the specified `token`. */
|
||||
export function postfix(token: string): (
|
||||
export function postfix(token: "++" | "--"): (
|
||||
target: any,
|
||||
propertyKey: string,
|
||||
descriptor: TypedPropertyDescriptor<any>
|
||||
|
Reference in New Issue
Block a user