@glint/type-test 1.4.1-unstable.ff9ea6c → 1.5.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.
package/README.md CHANGED
@@ -17,7 +17,7 @@ It's similar in concept to (and built on) the [`expect-type`][et] library.
17
17
  For strict-mode templates, the `expectTypeOf` helper and `to` collection of expectations are
18
18
  both directly importable from `@glint/type-test`.
19
19
 
20
- ```glimmer-ts
20
+ ```tsx
21
21
  import { expectTypeOf, to } from '@glint/type-test';
22
22
 
23
23
  let letters = ['a', 'b', 'c'];
@@ -35,7 +35,7 @@ let letters = ['a', 'b', 'c'];
35
35
  For "classic" loose-mode Ember templates, `@glint/type-test` provides a `typeTest` wrapper that
36
36
  will pass `expectTypeOf` and `to` to your template as args:
37
37
 
38
- ```ts
38
+ ```tsx
39
39
  import { typeTest } from '@glint/type-test';
40
40
  import { hbs } from 'ember-cli-htmlbars';
41
41
 
@@ -52,7 +52,7 @@ typeTest(
52
52
  You can also optionally provide an initial `this` value to `typeTest` to make values available
53
53
  in your template to either test inference against or to use as a basis for comparing type equality.
54
54
 
55
- ```ts
55
+ ```tsx
56
56
  import { typeTest } from '@glint/type-test';
57
57
  import { hbs } from 'ember-cli-htmlbars';
58
58
 
@@ -72,7 +72,7 @@ typeTest(
72
72
  This library provides a set of expectations to compare the type of a given value to common simple
73
73
  types.
74
74
 
75
- ```glimmer-ts
75
+ ```tsx
76
76
  import { expectTypeOf, to } from '@glint/type-test';
77
77
 
78
78
  let symbolValue = Symbol('hi');
@@ -95,7 +95,7 @@ let neverValue: never = (null as never);
95
95
 
96
96
  It also provides expectations that allow you to compare the type of one value to that of another.
97
97
 
98
- ```glimmer-ts
98
+ ```tsx
99
99
  import { expectTypeOf, to } from '@glint/type-test';
100
100
 
101
101
  let a: 'a' | 'b' = 'a';
package/lib/index.d.ts CHANGED
@@ -16,15 +16,15 @@ interface BinaryExpectations<T, U> {
16
16
  assignableTo: [Extends<T, U>, 'Expected first type to be assignable to the second'];
17
17
  }
18
18
  declare const Expectation: unique symbol;
19
- type Expectation<T> = {
19
+ declare type Expectation<T> = {
20
20
  [Expectation]: T;
21
21
  };
22
- type UnaryExpectationKind = keyof UnaryExpectations<any>;
23
- type UnaryExpectation<K extends UnaryExpectationKind> = Expectation<K>;
24
- type BinaryExpectationKind = keyof BinaryExpectations<any, any>;
25
- type BinaryExpectation<K extends BinaryExpectationKind> = Expectation<K>;
26
- type UnmetExpectation<M, T> = [M, T];
27
- type TypeTestTemplate<T> = abstract new () => HasContext<{
22
+ declare type UnaryExpectationKind = keyof UnaryExpectations<any>;
23
+ declare type UnaryExpectation<K extends UnaryExpectationKind> = Expectation<K>;
24
+ declare type BinaryExpectationKind = keyof BinaryExpectations<any, any>;
25
+ declare type BinaryExpectation<K extends BinaryExpectationKind> = Expectation<K>;
26
+ declare type UnmetExpectation<M, T> = [M, T];
27
+ declare type TypeTestTemplate<T> = abstract new () => HasContext<{
28
28
  this: T;
29
29
  args: {
30
30
  expectTypeOf: typeof expectTypeOf;
@@ -33,7 +33,7 @@ type TypeTestTemplate<T> = abstract new () => HasContext<{
33
33
  blocks: {};
34
34
  element: unknown;
35
35
  }>;
36
- type ExpectTypeOf = DirectInvokable<{
36
+ declare type ExpectTypeOf = DirectInvokable<{
37
37
  <T, E extends UnaryExpectationKind>(actual: T, expectation: UnaryExpectation<E>): UnaryExpectations<T>[E] extends [false, infer M] ? UnmetExpectation<M, T> : void;
38
38
  <T, E extends BinaryExpectationKind, U>(actual: T, expectation: BinaryExpectation<E>, expected: U): BinaryExpectations<T, U>[E] extends [false, infer M] ? UnmetExpectation<M, [T, U]> : void;
39
39
  }>;
@@ -85,4 +85,3 @@ export declare function typeTest<T>(context: T, template: TypeTestTemplate<T>):
85
85
  export declare function typeTest(template: TypeTestTemplate<null>): void;
86
86
  export declare function typeTest(...args: Array<unknown>): void;
87
87
  export {};
88
- //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glint/type-test",
3
- "version": "1.4.1-unstable.ff9ea6c",
3
+ "version": "1.5.0",
4
4
  "repository": "typed-ember/glint",
5
5
  "description": "Tools for testing inferred types in Glint-enabled templates",
6
6
  "license": "MIT",
@@ -15,15 +15,13 @@
15
15
  "lib"
16
16
  ],
17
17
  "scripts": {
18
- "test": "echo 'no standalone tests within this project'",
19
- "test:typecheck": "glint -p __tests__",
20
- "test:tsc": "echo 'no standalone tsc within this project'"
18
+ "test": "glint -p __tests__"
21
19
  },
22
20
  "dependencies": {
23
21
  "expect-type": "^0.15.0"
24
22
  },
25
23
  "peerDependencies": {
26
- "@glint/template": "1.4.1-unstable.ff9ea6c"
24
+ "@glint/template": "^1.5.0"
27
25
  },
28
26
  "publishConfig": {
29
27
  "access": "public"
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAKxE,UAAU,iBAAiB,CAAC,CAAC;IAC3B,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,uCAAuC,CAAC,CAAC;IACpE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,uCAAuC,CAAC,CAAC;IACpE,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,wCAAwC,CAAC,CAAC;IACvE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,yCAAyC,CAAC,CAAC;IACtE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,oCAAoC,CAAC,CAAC;IACtD,OAAO,EAAE,CAAC,SAAS,CAAC,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