element-vir 10.1.0 → 10.1.1
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,6 +1,6 @@
|
|
|
1
1
|
import { AsyncDirective } from 'lit/async-directive.js';
|
|
2
2
|
import { PartInfo } from 'lit/directive.js';
|
|
3
|
-
import {
|
|
3
|
+
import { ElementDefinitionWithInputsType } from './assign.directive';
|
|
4
4
|
export type CleanupCallback<T> = (oldValue: T) => void;
|
|
5
5
|
/**
|
|
6
6
|
* Assign values but include a cleanup callback which gets called when a new value gets assigned so
|
|
@@ -10,7 +10,7 @@ export type CleanupCallback<T> = (oldValue: T) => void;
|
|
|
10
10
|
*
|
|
11
11
|
* Example use case: 3D graphics applications with classes that setup buffers and the like.
|
|
12
12
|
*/
|
|
13
|
-
export declare function assignWithCleanup<DeclarativeElementGeneric extends
|
|
13
|
+
export declare function assignWithCleanup<DeclarativeElementGeneric extends ElementDefinitionWithInputsType>(elementDefinition: DeclarativeElementGeneric, inputsObject: DeclarativeElementGeneric extends ElementDefinitionWithInputsType<infer InputsGeneric> ? InputsGeneric : never, cleanupCallback: CleanupCallback<DeclarativeElementGeneric extends ElementDefinitionWithInputsType<infer InputsGeneric> ? InputsGeneric : never>): import("lit-html/directive").DirectiveResult<typeof AssignWithCleanupDirectiveClass>;
|
|
14
14
|
declare class AssignWithCleanupDirectiveClass extends AsyncDirective {
|
|
15
15
|
private readonly element;
|
|
16
16
|
private lastValue;
|
|
@@ -18,7 +18,7 @@ declare class AssignWithCleanupDirectiveClass extends AsyncDirective {
|
|
|
18
18
|
private hasBeenAssigned;
|
|
19
19
|
constructor(partInfo: PartInfo);
|
|
20
20
|
disconnected(): void;
|
|
21
|
-
render(elementDefinition:
|
|
21
|
+
render(elementDefinition: ElementDefinitionWithInputsType, inputsObject: Record<PropertyKey, unknown>, cleanupCallback: CleanupCallback<any>): symbol;
|
|
22
22
|
}
|
|
23
23
|
export {};
|
|
24
24
|
//# sourceMappingURL=assign-with-clean-up.directive.d.ts.map
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { DirectiveResult } from 'lit/directive.js';
|
|
2
|
-
import {
|
|
2
|
+
import { PropertyInitMapBase } from '../properties/element-properties';
|
|
3
|
+
export type ElementDefinitionWithInputsType<InputsType extends PropertyInitMapBase = PropertyInitMapBase> = {
|
|
4
|
+
inputsType: InputsType;
|
|
5
|
+
};
|
|
3
6
|
/** Assign an object matching an element's inputs to its inputs. */
|
|
4
|
-
export declare function assign<DeclarativeElementGeneric extends
|
|
5
|
-
export declare function assign<DeclarativeElementGeneric extends
|
|
6
|
-
export declare function assignInputsObject<DeclarativeElementDefinitionGeneric extends
|
|
7
|
+
export declare function assign<DeclarativeElementGeneric extends ElementDefinitionWithInputsType>(declarativeElement: DeclarativeElementGeneric, inputsObject: DeclarativeElementGeneric['inputsType']): DirectiveResult;
|
|
8
|
+
export declare function assign<DeclarativeElementGeneric extends ElementDefinitionWithInputsType>(inputsObject: Record<string, any>): DirectiveResult;
|
|
9
|
+
export declare function assignInputsObject<DeclarativeElementDefinitionGeneric extends ElementDefinitionWithInputsType>(expectedElementConstructor: DeclarativeElementDefinitionGeneric | undefined, element: Element, assignmentObject: DeclarativeElementDefinitionGeneric['inputsType']): void;
|
|
7
10
|
//# sourceMappingURL=assign.directive.d.ts.map
|