File tree Expand file tree Collapse file tree
packages/type/src/testing/variables Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { SYMBOL_NUMBER , SYMBOL_STRING } from './symbol.const' ;
2- import { STRING } from './string.const' ;
1+ // Variables.
32import { NUMBER } from './number.const' ;
4- export interface ObjectOne {
5- 'key as string' ?: boolean ;
6- 1030405027 ?: string ;
7- 5 ?: string ;
8- [ SYMBOL_NUMBER ] ?: string ;
9- [ SYMBOL_STRING ] ?: number ;
10- x : number ;
11- }
12- export interface ObjectTwo { x : string ; y : number ; }
3+ import { STRING } from './string.const' ;
4+ import { SYMBOL_NUMBER , SYMBOL_STRING } from './strict/symbol.const' ;
5+ // Interface.
6+ import { DataDescriptor , } from '../interface' ;
7+ import { ObjectOne , ObjectTwo } from '../interface' ;
8+ // Type.
9+ import { ThisAccessorDescriptor } from '../type/this-accessor-descriptor.type'
10+
1311/**
1412 * @example https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects
1513 */
@@ -65,3 +63,22 @@ export const OBJECT_ONE_NEW = new Object(OBJECT_ONE);
6563 * instanceof Symbol === false
6664 */
6765export const OBJECT_TWO_NEW = new Object ( OBJECT_TWO ) ;
66+
67+
68+ export const DATA_DESCRIPTOR : DataDescriptor < string > = {
69+ configurable : true ,
70+ enumerable : true ,
71+ writable : true ,
72+ value : 'my value'
73+ }
74+
75+ export const ACCESSOR_DESCRIPTOR : ThisAccessorDescriptor < string | undefined , ObjectOne > = {
76+ configurable : true ,
77+ enumerable : true ,
78+ get ( ) : string | undefined {
79+ return this [ 5 ] ;
80+ } ,
81+ set ( value : string | undefined ) {
82+ this [ 5 ] = value ;
83+ }
84+ }
You can’t perform that action at this time.
0 commit comments