Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add two-way binding #5995

Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: add two-way binding",
"packageName": "@microsoft/fast-element",
"email": "[email protected]",
"dependentChangeType": "patch"
}
23 changes: 23 additions & 0 deletions packages/web-components/fast-element/docs/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ export type DecoratorAttributeConfiguration = Omit<AttributeConfiguration, "prop
// @public
export type DefaultBindingOptions = AddEventListenerOptions;

// @public
export type DefaultTwoWayBindingOptions = DefaultBindingOptions & {
changeEvent?: string;
fromView?: (value: any) => any;
};

// @public
export const DOM: Readonly<{
queueUpdate: (callable: Callable) => void;
Expand Down Expand Up @@ -813,6 +819,23 @@ export type TrustedTypesPolicy = {
createHTML(html: string): string;
};

// @public
export const twoWay: BindingConfig<DefaultTwoWayBindingOptions> & BindingConfigResolver<DefaultTwoWayBindingOptions>;

// @public
export class TwoWayBinding extends ChangeBinding {
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
static configure(settings: TwoWaySettings): void;
// @internal (undocumented)
handleEvent(event: Event): void;
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
}

// @public
export interface TwoWaySettings {
determineChangeEvent(directive: HTMLBindingDirective, target: HTMLElement): string;
}

// Warning: (ae-internal-missing-underscore) The name "TypeDefinition" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
Expand Down
Loading