Skip to content

Commit 5334dda

Browse files
committed
update some erroneous types and documentation
1 parent 3f42482 commit 5334dda

19 files changed

Lines changed: 44 additions & 45 deletions

packages/fast-element/SIZES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Bundle sizes for `@microsoft/fast-element` exports.
44

55
| Export | Minified | Gzip | Brotli |
66
|--------|----------|------|--------|
7-
| CDN Rollup Bundle | 62.60 KB | 18.64 KB | 16.77 KB |
7+
| CDN Rollup Bundle | 62.60 KB | 18.64 KB | 16.75 KB |
88
| FASTElement | 22.88 KB | 7.14 KB | 6.46 KB |
99
| Updates | 3.03 KB | 1.25 KB | 1.06 KB |
1010
| Observable | 7.55 KB | 2.76 KB | 2.48 KB |

packages/fast-element/docs/api-report.api.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ export type Callable = typeof Function.prototype.call | {
109109
};
110110

111111
// @public
112-
export interface CaptureType<TSource, TParent> {
112+
export interface CaptureType {
113113
}
114114

115115
// @public
116116
export interface ChildListDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, Omit<MutationObserverInit, "subtree" | "childList"> {
117117
}
118118

119119
// @public
120-
export function children<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | ChildrenDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
120+
export function children<TSource = any>(propertyOrOptions: (keyof TSource & string) | ChildrenDirectiveOptions<keyof TSource & string>): CaptureType;
121121

122122
// @public
123123
export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiveOptions> {
@@ -753,7 +753,7 @@ export class PropertyChangeNotifier implements Notifier {
753753
}
754754

755755
// @public
756-
export const ref: <TSource = any, TParent = any>(propertyName: keyof TSource & string) => CaptureType<TSource, TParent>;
756+
export const ref: <TSource = any>(propertyName: keyof TSource & string) => CaptureType;
757757

758758
// @public
759759
export class RefDirective extends StatelessAttachedAttributeDirective<string> {
@@ -762,7 +762,7 @@ export class RefDirective extends StatelessAttachedAttributeDirective<string> {
762762
}
763763

764764
// @public
765-
export function render<TSource = any, TItem = any, TParent = any>(value?: Expression<TSource, TItem> | Binding<TSource, TItem> | {}, template?: ContentTemplate | string | Expression<TSource, ContentTemplate | string | Node, TParent> | Binding<TSource, ContentTemplate | string | Node, TParent>): CaptureType<TSource, TParent>;
765+
export function render<TSource = any, TItem = any, TParent = any>(value?: Expression<TSource, TItem> | Binding<TSource, TItem> | {}, template?: ContentTemplate | string | Expression<TSource, ContentTemplate | string | Node, TParent> | Binding<TSource, ContentTemplate | string | Node, TParent>): CaptureType;
766766

767767
// @public
768768
export class RenderBehavior<TSource = any> implements ViewBehavior, Subscriber {
@@ -788,7 +788,7 @@ export class RenderDirective<TSource = any> implements HTMLDirective, ViewBehavi
788788
}
789789

790790
// @public
791-
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>, TParent = any>(items: Expression<TSource, TArray, TParent> | Binding<TSource, TArray, TParent> | ReadonlyArray<any>, template: Expression<TSource, ViewTemplate<any, TSource>> | Binding<TSource, ViewTemplate<any, TSource>> | ViewTemplate<any, TSource>, options?: RepeatOptions): CaptureType<TSource, TParent>;
791+
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>, TParent = any>(items: Expression<TSource, TArray, TParent> | Binding<TSource, TArray, TParent> | ReadonlyArray<any>, template: Expression<TSource, ViewTemplate<any, TSource>> | Binding<TSource, ViewTemplate<any, TSource>> | ViewTemplate<any, TSource>, options?: RepeatOptions): CaptureType;
792792

793793
// @public
794794
export class RepeatBehavior<TSource = any> implements ViewBehavior, Subscriber {
@@ -827,7 +827,7 @@ export interface ShadowRootOptions extends ShadowRootInit {
827827
}
828828

829829
// @public
830-
export function slotted<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | SlottedDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
830+
export function slotted<TSource = any>(propertyOrOptions: (keyof TSource & string) | SlottedDirectiveOptions<keyof TSource & string>): CaptureType;
831831

832832
// @public
833833
export class SlottedDirective extends NodeObservationDirective<SlottedDirectiveOptions> {
@@ -972,7 +972,7 @@ export interface SyntheticView<TSource = any, TParent = any> extends View<TSourc
972972
// @public
973973
export interface SyntheticViewTemplate<TSource = any, TParent = any> {
974974
create(): SyntheticView<TSource, TParent>;
975-
inline(): CaptureType<TSource, TParent>;
975+
inline(): CaptureType;
976976
}
977977

978978
// @public
@@ -990,7 +990,7 @@ export const TemplateOptions: {
990990
export type TemplateOptions = (typeof TemplateOptions)[keyof typeof TemplateOptions];
991991

992992
// @public
993-
export type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
993+
export type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType;
994994

995995
// @public
996996
export type TrustedTypesPolicy = {
@@ -1072,7 +1072,7 @@ export class ViewTemplate<TSource = any, TParent = any> implements ElementViewTe
10721072
static create<TSource = any, TParent = any>(strings: string[], values: TemplateValue<TSource, TParent>[], policy?: DOMPolicy): ViewTemplate<TSource, TParent>;
10731073
readonly factories: Record<string, ViewBehaviorFactory>;
10741074
readonly html: string | HTMLTemplateElement;
1075-
inline(): CaptureType<TSource, TParent>;
1075+
inline(): CaptureType;
10761076
render(source: TSource, host: Node, hostBindingTarget?: Element): HTMLView<TSource, TParent>;
10771077
withPolicy(policy: DOMPolicy): this;
10781078
}
@@ -1081,7 +1081,7 @@ export class ViewTemplate<TSource = any, TParent = any> implements ElementViewTe
10811081
export function volatile(target: {}, name: string | Accessor, descriptor: PropertyDescriptor): PropertyDescriptor;
10821082

10831083
// @public
1084-
export function when<TSource = any, TReturn = any, TParent = any>(condition: Expression<TSource, TReturn, TParent> | boolean, templateOrTemplateBinding: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>, elseTemplateOrTemplateBinding?: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>): CaptureType<TSource, TParent>;
1084+
export function when<TSource = any, TReturn = any, TParent = any>(condition: Expression<TSource, TReturn, TParent> | boolean, templateOrTemplateBinding: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>, elseTemplateOrTemplateBinding?: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>): CaptureType;
10851085

10861086
// Warnings were encountered during analysis:
10871087
//

packages/fast-element/src/templating/children.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ HTMLDirective.define(ChildrenDirective);
106106
* @param propertyOrOptions - The options used to configure child node observation.
107107
* @public
108108
*/
109-
export function children<TSource = any, TParent = any>(
109+
export function children<TSource = any>(
110110
propertyOrOptions:
111111
| (keyof TSource & string)
112-
| ChildrenDirectiveOptions<keyof TSource & string>
113-
): CaptureType<TSource, TParent> {
112+
| ChildrenDirectiveOptions<keyof TSource & string>,
113+
): CaptureType {
114114
if (isString(propertyOrOptions)) {
115115
propertyOrOptions = {
116116
property: propertyOrOptions,

packages/fast-element/src/templating/ref.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,5 @@ HTMLDirective.define(RefDirective);
3131
* @param propertyName - The name of the property to assign the reference to.
3232
* @public
3333
*/
34-
export const ref = <TSource = any, TParent = any>(
35-
propertyName: keyof TSource & string
36-
): CaptureType<TSource, TParent> => new RefDirective(propertyName);
34+
export const ref = <TSource = any>(propertyName: keyof TSource & string): CaptureType =>
35+
new RefDirective(propertyName);

packages/fast-element/src/templating/render.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ export function render<TSource = any, TItem = any, TParent = any>(
678678
| string
679679
| Expression<TSource, ContentTemplate | string | Node, TParent>
680680
| Binding<TSource, ContentTemplate | string | Node, TParent>,
681-
): CaptureType<TSource, TParent> {
681+
): CaptureType {
682682
let dataBinding: Binding<TSource>;
683683

684684
if (value === void 0) {

packages/fast-element/src/templating/repeat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ export function repeat<
546546
| Binding<TSource, ViewTemplate<any, TSource>>
547547
| ViewTemplate<any, TSource>,
548548
options: RepeatOptions = defaultRepeatOptions,
549-
): CaptureType<TSource, TParent> {
549+
): CaptureType {
550550
const dataBinding = normalizeBinding(items);
551551
const templateBinding = normalizeBinding(template);
552552
return new RepeatDirective(dataBinding, templateBinding, {

packages/fast-element/src/templating/slotted.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ HTMLDirective.define(SlottedDirective);
6060
* @param propertyOrOptions - The options used to configure slotted node observation.
6161
* @public
6262
*/
63-
export function slotted<TSource = any, TParent = any>(
63+
export function slotted<TSource = any>(
6464
propertyOrOptions:
6565
| (keyof TSource & string)
66-
| SlottedDirectiveOptions<keyof TSource & string>
67-
): CaptureType<TSource, TParent> {
66+
| SlottedDirectiveOptions<keyof TSource & string>,
67+
): CaptureType {
6868
if (isString(propertyOrOptions)) {
6969
propertyOrOptions = { property: propertyOrOptions };
7070
}
7171

7272
return new SlottedDirective(
73-
propertyOrOptions as SlottedDirectiveOptions<keyof TSource & string>
73+
propertyOrOptions as SlottedDirectiveOptions<keyof TSource & string>,
7474
);
7575
}

packages/fast-element/src/templating/when.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { CaptureType, SyntheticViewTemplate } from "./template.js";
44

55
const noTemplate = () => null;
66
function normalizeBinding<TSource>(
7-
value: SyntheticViewTemplate | Expression<TSource, SyntheticViewTemplate> | undefined
7+
value: SyntheticViewTemplate | Expression<TSource, SyntheticViewTemplate> | undefined,
88
) {
99
return value === undefined ? noTemplate : isFunction(value) ? value : () => value;
1010
}
@@ -24,8 +24,8 @@ export function when<TSource = any, TReturn = any, TParent = any>(
2424
| Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>,
2525
elseTemplateOrTemplateBinding?:
2626
| SyntheticViewTemplate<TSource, TParent>
27-
| Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>
28-
): CaptureType<TSource, TParent> {
27+
| Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>,
28+
): CaptureType {
2929
const dataBinding = isFunction(condition) ? condition : () => condition;
3030
const templateBinding = normalizeBinding(templateOrTemplateBinding);
3131
const elseBinding = normalizeBinding(elseTemplateOrTemplateBinding);

sites/website/src/docs/3.x/api/fast-element.capturetype.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ A marker interface used to capture types when interpolating Directive helpers in
2020
**Signature:**
2121

2222
```typescript
23-
export interface CaptureType<TSource, TParent>
23+
export interface CaptureType
2424
```

sites/website/src/docs/3.x/api/fast-element.children.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ A directive that observes the `childNodes` of an element and updates a property
2020
**Signature:**
2121

2222
```typescript
23-
export declare function children<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | ChildrenDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
23+
export declare function children<TSource = any>(propertyOrOptions: (keyof TSource & string) | ChildrenDirectiveOptions<keyof TSource & string>): CaptureType;
2424
```
2525

2626
## Parameters
@@ -61,4 +61,4 @@ The options used to configure child node observation.
6161

6262
**Returns:**
6363

64-
[CaptureType](../fast-element.capturetype/)<!-- -->&lt;TSource, TParent&gt;
64+
[CaptureType](../fast-element.capturetype/)

0 commit comments

Comments
 (0)