chore: format

This commit is contained in:
Nathan Walker
2020-07-05 14:57:06 -07:00
parent 8f2900ad0b
commit da3c0b973d
379 changed files with 71587 additions and 54582 deletions

View File

@@ -2,20 +2,25 @@ import { CreateViewEventData } from "./placeholder-common";
import { View, CSSType } from "../core/view";
import { EventData } from "../../data/observable";
export * from './placeholder-common';
export * from "./placeholder-common";
@CSSType("Placeholder")
export class Placeholder extends View {
public static creatingViewEvent = "creatingView";
public static creatingViewEvent = "creatingView";
public createNativeView() {
const args = <CreateViewEventData>{ eventName: Placeholder.creatingViewEvent, object: this, view: undefined, context: this._context };
this.notify(args);
public createNativeView() {
const args = <CreateViewEventData>{
eventName: Placeholder.creatingViewEvent,
object: this,
view: undefined,
context: this._context,
};
this.notify(args);
return <android.view.View>args.view;
}
return <android.view.View>args.view;
}
}
export interface Placeholder {
on(eventNames: string, callback: (args: EventData) => void);
on(event: "creatingView", callback: (args: CreateViewEventData) => void);
on(eventNames: string, callback: (args: EventData) => void);
on(event: "creatingView", callback: (args: CreateViewEventData) => void);
}

View File

@@ -1,42 +1,42 @@
import { View } from "../core/view";
import { EventData } from "../../data/observable";
export * from './placeholder-common';
export * from "./placeholder-common";
/**
* Represents a Placeholder, which is used to add a native view to the visual tree.
*/
export class Placeholder extends View {
/**
* String value used when hooking to creatingView event.
*/
public static creatingViewEvent: string;
/**
* String value used when hooking to creatingView event.
*/
public static creatingViewEvent: string;
/**
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
* @param callback - Callback function which will be executed when event is raised.
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
*/
on(eventNames: string, callback: (args: EventData) => void);
/**
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
* @param callback - Callback function which will be executed when event is raised.
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
*/
on(eventNames: string, callback: (args: EventData) => void);
/**
* Raised when a creatingView event occurs.
*/
on(event: "creatingView", callback: (args: CreateViewEventData) => void);
/**
* Raised when a creatingView event occurs.
*/
on(event: "creatingView", callback: (args: CreateViewEventData) => void);
}
/**
* Event data containing information for creating a native view that will be added to the visual tree.
*/
export interface CreateViewEventData extends EventData {
/**
* The native view that should be added to the visual tree.
*/
view: any;
/**
* The native view that should be added to the visual tree.
*/
view: any;
/**
* An optional context for creating the view.
*/
context?: any;
/**
* An optional context for creating the view.
*/
context?: any;
}

View File

@@ -2,19 +2,24 @@ import { View } from "../core/view";
import { CreateViewEventData } from "./placeholder-common";
import { EventData } from "../../data/observable";
export * from './placeholder-common';
export * from "./placeholder-common";
export class Placeholder extends View {
public static creatingViewEvent = "creatingView";
public static creatingViewEvent = "creatingView";
public createNativeView() {
const args = <CreateViewEventData>{ eventName: Placeholder.creatingViewEvent, object: this, view: undefined, context: this._context };
this.notify(args);
public createNativeView() {
const args = <CreateViewEventData>{
eventName: Placeholder.creatingViewEvent,
object: this,
view: undefined,
context: this._context,
};
this.notify(args);
return args.view;
}
return args.view;
}
}
export interface Placeholder {
on(eventNames: string, callback: (args: EventData) => void);
on(event: "creatingView", callback: (args: CreateViewEventData) => void);
on(eventNames: string, callback: (args: EventData) => void);
on(event: "creatingView", callback: (args: CreateViewEventData) => void);
}

View File

@@ -1,13 +1,13 @@
import { EventData } from "../../data/observable";
export interface CreateViewEventData extends EventData {
/**
* The native view that should be added to the visual tree.
*/
view: any;
/**
* The native view that should be added to the visual tree.
*/
view: any;
/**
* An optional context for creating the view.
*/
context?: any;
}
/**
* An optional context for creating the view.
*/
context?: any;
}