@glint/template 0.6.1 → 0.6.2
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,4 +1,5 @@
|
|
|
1
|
-
import { DirectInvokable,
|
|
1
|
+
import { DirectInvokable, Invokable, Invoke, InvokeDirect } from '../integration';
|
|
2
|
+
import { ResolveOrReturn } from './types';
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
5
|
* We have multiple ways of representing invokable values, dictated by certain constraints
|
|
@@ -45,8 +46,4 @@ export declare function resolve<Args extends unknown[], Instance extends Invokab
|
|
|
45
46
|
* value of the appropriate type.
|
|
46
47
|
*/
|
|
47
48
|
|
|
48
|
-
export declare
|
|
49
|
-
export declare function resolveOrReturn<Args extends unknown[], Instance extends Invokable>(
|
|
50
|
-
item: (new (...args: Args) => Instance) | null | undefined
|
|
51
|
-
): (...args: Parameters<Instance[typeof Invoke]>) => ReturnType<Instance[typeof Invoke]>;
|
|
52
|
-
export declare function resolveOrReturn<T>(item: T): (args: EmptyObject) => T;
|
|
49
|
+
export declare const resolveOrReturn: ResolveOrReturn<typeof resolve>;
|
package/-private/dsl/types.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { HasContext } from '@glint/template/-private/integration';
|
|
1
|
+
import { EmptyObject, HasContext } from '@glint/template/-private/integration';
|
|
2
2
|
|
|
3
3
|
type Constructor<T> = new (...args: any) => T;
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* A utility for constructing the type of an environment's `resolveOrReturn` from
|
|
7
|
+
* the type of its `resolve` function.
|
|
8
|
+
*/
|
|
9
|
+
export type ResolveOrReturn<T> = T & (<U>(item: U) => (args: EmptyObject) => U);
|
|
10
|
+
|
|
5
11
|
/**
|
|
6
12
|
* Given a tag name, returns an appropriate `Element` subtype.
|
|
7
13
|
* NOTE: This will return a union for elements that exist both in HTML and SVG. Technically, this will be too permissive.
|