-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduction.ts
55 lines (45 loc) · 1.37 KB
/
production.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import type {
AnyLocator,
CreateComponentLocator,
CreateRootLocatorFunction,
GetLocatorParametersFunction,
RemoveMarkFromPropertiesFunction,
} from './oldTypes';
export const anyLocator: AnyLocator = new Proxy(
Object.setPrototypeOf(() => {}, null),
{
apply: () => attributes,
defineProperty: () => true,
deleteProperty: () => true,
get(target, property) {
if (property === Symbol.toPrimitive || property === 'toJSON') return toString;
return anyLocator satisfies typeof target;
},
preventExtensions: () => false,
},
);
export const createLocator = (() => anyLocator) as unknown as CreateComponentLocator;
export const createRootLocator = (() => anyLocator) as CreateRootLocatorFunction;
export const getLocatorParameters = (() => anyLocator) as GetLocatorParametersFunction;
export const removeMarkFromProperties = ((properties) =>
properties) as RemoveMarkFromPropertiesFunction;
export const setGlobalProductionMode = (): void => {};
export type {
AnyMark,
Attributes,
CreateLocator,
GetLocatorParameters,
Locator,
LocatorConstraint,
LocatorDescriptionConstraint,
LocatorOfElement,
Mark,
Node,
ParametersConstraint,
PropertiesWithMarkConstraint,
PropertiesWithMarkWithParametersConstraint,
RemoveMarkFromProperties,
RootOptions,
} from './oldTypes';
const attributes = {};
const toString = (): string => '';