@lppedd/di-wise-neo 0.12.1 → 0.13.0

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.
@@ -1,35 +1,19 @@
1
1
  /**
2
2
  * Type API.
3
3
  */
4
- interface Type<A> {
4
+ interface Type<T> {
5
5
  /**
6
6
  * The name of the type.
7
7
  */
8
8
  readonly name: string;
9
9
  /**
10
- * Creates an intersection type from another type.
10
+ * Ensures that different `Type<T>` types are not structurally compatible.
11
11
  *
12
- * @example
13
- * ```ts
14
- * const A = createType<A>("A");
15
- * const B = createType<B>("B");
16
- *
17
- * A.inter("I", B); // => Type<A & B>
18
- * ```
19
- */
20
- inter<B>(typeName: string, B: Type<B>): Type<A & B>;
21
- /**
22
- * Creates a union type from another type.
12
+ * This property is never used at runtime.
23
13
  *
24
- * @example
25
- * ```ts
26
- * const A = createType<A>("A");
27
- * const B = createType<B>("B");
28
- *
29
- * A.union("U", B); // => Type<A | B>
30
- * ```
14
+ * @private
31
15
  */
32
- union<B>(typeName: string, B: Type<B>): Type<A | B>;
16
+ readonly __type?: T;
33
17
  }
34
18
  /**
35
19
  * Constructor type.
package/dist/cjs/index.js CHANGED
@@ -349,15 +349,11 @@ const Scope = {
349
349
  *
350
350
  * @__NO_SIDE_EFFECTS__
351
351
  */ function createType(typeName) {
352
- const type = {
353
- name: `Type<${typeName}>`,
354
- inter: createType,
355
- union: createType,
356
- toString () {
357
- return type.name;
358
- }
352
+ const name = `Type<${typeName}>`;
353
+ return {
354
+ name: name,
355
+ toString: ()=>name
359
356
  };
360
- return type;
361
357
  }
362
358
  // @internal
363
359
  function isConstructor(token) {