@primno/core
Version:
Front-end framework for Model-Driven Apps of Power Apps and Dynamics 365.
45 lines (44 loc) • 1.4 kB
TypeScript
/**
* Decorator that mark a property of a component as input.
*
* The input property name must be `input`. An other property name is not supported.
* The `Input` interface contains this constraint.
* It is recommended to inherit from it when you need to define an input in your component.
*
* The input property will be set by the value given by the parent component.
* See {@link MnSubComponent} for more information about transmission of the input from a parent component to its sub component.
*
* @example A parent component send an input (10, "hello") to its sub component.
* ```ts
* @MnComponent({
* scope: {
* pageType: "record"
* }
* })
* class ParentComponent {
* @MnSubComponent({
* component: ChildComponent,
* input: {
* value1: 10,
* value2: "hello"
* }
* })
* child: SubComponent<ChildComponent>;
* }
*
* @MnComponent({
* scope: {
* pageType: "record"
* }
* })
* class ChildComponent implements Input {
* @MnInput()
* input: {
* value1: number;
* value2: string;
* };
* }
* ```
* @category Component
*/
export declare function MnInput(): (target: import("inversify/lib/annotation/decorator_utils").DecoratorTarget<unknown>, targetKey?: string | symbol | undefined, indexOrPropertyDescriptor?: number | TypedPropertyDescriptor<any> | undefined) => void;