@microsoft/decorators 1.22.0-beta.1 → 1.22.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/decorators.manifest.json +9 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +15 -0
- package/lib/override.d.ts +11 -0
- package/lib/override.d.ts.map +1 -0
- package/lib/override.js +16 -0
- package/lib/sealed.d.ts +10 -0
- package/lib/sealed.d.ts.map +1 -0
- package/lib/sealed.js +14 -0
- package/lib/virtual.d.ts +12 -0
- package/lib/virtual.d.ts.map +1 -0
- package/lib/virtual.js +17 -0
- package/package.json +2 -2
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A conservative set of decorators intended for use in both NodeJS and web browser projects.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This package provides a small set of decorators that enable more rigorous specification
|
|
6
|
+
* of API contracts when using the TypeScript language. The intent is to better document
|
|
7
|
+
* expected behaviors and catch common mistakes. This package is not intended to be a
|
|
8
|
+
* general toolkit of language extensions or helpful macros.
|
|
9
|
+
*
|
|
10
|
+
* @packagedocumentation
|
|
11
|
+
*/
|
|
12
|
+
export { virtual } from './virtual';
|
|
13
|
+
export { sealed } from './sealed';
|
|
14
|
+
export { override } from './override';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A conservative set of decorators intended for use in both NodeJS and web browser projects.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This package provides a small set of decorators that enable more rigorous specification
|
|
6
|
+
* of API contracts when using the TypeScript language. The intent is to better document
|
|
7
|
+
* expected behaviors and catch common mistakes. This package is not intended to be a
|
|
8
|
+
* general toolkit of language extensions or helpful macros.
|
|
9
|
+
*
|
|
10
|
+
* @packagedocumentation
|
|
11
|
+
*/
|
|
12
|
+
export { virtual } from './virtual';
|
|
13
|
+
export { sealed } from './sealed';
|
|
14
|
+
export { override } from './override';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This decorator is applied to a class's member function or property.
|
|
3
|
+
* It indicates that the definition overrides another definition (of the same name)
|
|
4
|
+
* from the base class. The base class definition must be marked as \@virtual.
|
|
5
|
+
* This decorator is currently used for documentation purposes only.
|
|
6
|
+
* In the future, it may be enforced at runtime.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare function override(target: object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>): void;
|
|
11
|
+
//# sourceMappingURL=override.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"override.d.ts","sourceRoot":"","sources":["../src/override.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,EAE5B,UAAU,EAAE,uBAAuB,CAAC,GAAG,CAAC,GACvC,IAAI,CAGN"}
|
package/lib/override.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This decorator is applied to a class's member function or property.
|
|
3
|
+
* It indicates that the definition overrides another definition (of the same name)
|
|
4
|
+
* from the base class. The base class definition must be marked as \@virtual.
|
|
5
|
+
* This decorator is currently used for documentation purposes only.
|
|
6
|
+
* In the future, it may be enforced at runtime.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export function override(target, propertyKey,
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
descriptor) {
|
|
13
|
+
// Eventually we may implement runtime validation (e.g. in DEBUG builds)
|
|
14
|
+
// but currently this decorator is only used by the build tools.
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=override.js.map
|
package/lib/sealed.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This decorator is applied to a class (but NOT member function or property).
|
|
3
|
+
* It indicates that subclasses must not inherit from this class.
|
|
4
|
+
* This decorator is currently used for documentation purposes only.
|
|
5
|
+
* In the future, it may be enforced at runtime.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare function sealed(target: Function): void;
|
|
10
|
+
//# sourceMappingURL=sealed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sealed.d.ts","sourceRoot":"","sources":["../src/sealed.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wBAAgB,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAG7C"}
|
package/lib/sealed.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This decorator is applied to a class (but NOT member function or property).
|
|
3
|
+
* It indicates that subclasses must not inherit from this class.
|
|
4
|
+
* This decorator is currently used for documentation purposes only.
|
|
5
|
+
* In the future, it may be enforced at runtime.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
10
|
+
export function sealed(target) {
|
|
11
|
+
// Eventually we may implement runtime validation (e.g. in DEBUG builds)
|
|
12
|
+
// but currently this decorator is only used by the build tools.
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=sealed.js.map
|
package/lib/virtual.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This decorator is applied to a class's member function or property.
|
|
3
|
+
* It indicates that the definition may optionally be overridden in a
|
|
4
|
+
* child class. Conversely, if the \@virtual decorator is NOT applied to
|
|
5
|
+
* a definition, then child classes may NOT override it.
|
|
6
|
+
* This decorator is currently used for documentation purposes only.
|
|
7
|
+
* In the future, it may be enforced at runtime.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare function virtual(target: object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>): void;
|
|
12
|
+
//# sourceMappingURL=virtual.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual.d.ts","sourceRoot":"","sources":["../src/virtual.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,EAE5B,UAAU,EAAE,uBAAuB,CAAC,GAAG,CAAC,GACvC,IAAI,CAGN"}
|
package/lib/virtual.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This decorator is applied to a class's member function or property.
|
|
3
|
+
* It indicates that the definition may optionally be overridden in a
|
|
4
|
+
* child class. Conversely, if the \@virtual decorator is NOT applied to
|
|
5
|
+
* a definition, then child classes may NOT override it.
|
|
6
|
+
* This decorator is currently used for documentation purposes only.
|
|
7
|
+
* In the future, it may be enforced at runtime.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export function virtual(target, propertyKey,
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
descriptor) {
|
|
14
|
+
// Eventually we may implement runtime validation (e.g. in DEBUG builds)
|
|
15
|
+
// but currently this decorator is only used by the build tools.
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=virtual.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/decorators",
|
|
3
|
-
"version": "1.22.0-beta.
|
|
3
|
+
"version": "1.22.0-beta.3",
|
|
4
4
|
"description": "A very conservative set of decorators for TypeScript projects",
|
|
5
5
|
"license": "https://aka.ms/spfx/license",
|
|
6
6
|
"homepage": "http://aka.ms/spfx",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"tslib": "2.3.1"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@rushstack/heft": "0.
|
|
15
|
+
"@rushstack/heft": "0.74.3",
|
|
16
16
|
"eslint": "8.57.1",
|
|
17
17
|
"@msinternal/spfx-internal-web-build-rig": "0.1.0"
|
|
18
18
|
},
|