Skip to content

Commit

Permalink
v0.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TahaSh committed Jul 28, 2024
1 parent a7a9c72 commit bcd0c08
Show file tree
Hide file tree
Showing 4 changed files with 871 additions and 656 deletions.
50 changes: 34 additions & 16 deletions dist/veloxi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,19 @@ declare class CoreView implements View {
private _elementReader;
private _viewParents;
private _temporaryView;
private _inverseEffect;
private _inverseEffect?;
private _renderNextTick;
private _layoutOption;
private _elementObserver;
private _hasReadElement;
private _shouldReadRect;
private _readWithScroll;
private _externalUserStyles;
constructor(element: HTMLElement, name: string, registry: Registry, layoutId?: string);
destroy(): void;
get elementReader(): ElementReader;
get layoutOption(): LayoutOption;
_getLayoutOption(): LayoutOption;
setElement(element: HTMLElement): void;
get layoutId(): string | undefined;
get position(): ViewPosition;
Expand Down Expand Up @@ -165,14 +173,17 @@ declare class CoreView implements View {
overlapsWith(view: View): boolean;
distanceTo(view: View): number;
read(): void;
setHasReadElement(value: boolean): void;
get rect(): ViewRect;
get previousRect(): ViewRect;
update(ts: number, dt: number): void;
_updatePreviousRect(): void;
setAsTemporaryView(): void;
get isTemporaryView(): boolean;
get shouldRender(): boolean;
_cleanCssText(cssText: string): string;
render(): void;
private _getExternalUserStyles;
private _getUserStyles;
markAsAdded(): void;
onAdd(callback: OnAddCallback): void;
Expand Down Expand Up @@ -230,6 +241,7 @@ declare class DragEvent_2 {
height: number;
distance: number;
isDragging: boolean;
stopped: boolean;
target: EventTarget | null;
directions: Array<Direction>;
};
Expand All @@ -246,6 +258,7 @@ declare class DragEvent_2 {
width: number;
height: number;
distance: number;
stopped: boolean;
constructor(props: {
view: View;
previousX: number;
Expand All @@ -258,6 +271,7 @@ declare class DragEvent_2 {
height: number;
distance: number;
isDragging: boolean;
stopped: boolean;
target: EventTarget | null;
directions: Array<Direction>;
});
Expand All @@ -273,11 +287,12 @@ export declare class DragEventPlugin extends EventPlugin {
private _pointerDownPerView;
private _targetPerView;
private _viewPointerPositionLog;
private _stopTimer;
setup(): void;
onSelect(e: Event): void;
get _isDragging(): boolean;
subscribeToEvents(eventBus: EventBus): void;
_emitEvent(view: View, directions: Array<Direction>): void;
_emitEvent(view: View, directions: Array<Direction>, stopped?: boolean): void;
private _calculateDirections;
}

Expand All @@ -301,16 +316,17 @@ declare class ElementReader {
private _element;
private _rect;
private _computedStyle;
constructor(element: HTMLElement);
read<K extends keyof ViewPropNameToElementPropValue>(propName: K): ViewPropNameToElementPropValue[K] | undefined;
private _pageRectReader;
private _scroll;
constructor(view: CoreView);
invalidatePageRect(): void;
update(includeScroll?: boolean): void;
get rect(): ViewRect;
get opacity(): ElementPropValue<number>;
get borderRadius(): ElementPropValue<BorderRadiusValue>;
get origin(): ElementPropValue<Vec2>;
get scroll(): {
y: number;
x: number;
};
_calculateScroll(): Point;
get scroll(): Point;
}

export declare class EventBus {
Expand Down Expand Up @@ -409,6 +425,8 @@ declare interface IViewProp {
shouldRender: boolean;
}

declare type LayoutOption = 'position' | 'size' | 'all';

declare function minBy<T>(items: Array<T>, predicate: (item: T) => number): T;

declare interface OnAddCallback {
Expand Down Expand Up @@ -445,6 +463,11 @@ declare class OriginProp extends ViewProp<Vec2> implements ViewOrigin {
isTransform(): boolean;
}

declare interface PageRect {
left: number;
top: number;
}

declare class Plugin_2<TConfig extends PluginConfig = PluginConfig, TPluginApi extends PluginApi = PluginApi> extends IPlugin<TConfig, TPluginApi> {
isRenderable(): boolean;
isInitialized(): boolean;
Expand Down Expand Up @@ -576,6 +599,7 @@ declare class Registry {
private _getPluginNameForElement;
private _getPluginIdForElement;
private _isScopedElement;
private _removeElementsWithParent;
private _handleAddedViews;
private _getLayoutIdForElement;
private _createNewView;
Expand Down Expand Up @@ -604,6 +628,7 @@ declare class Registry {
updatePlugin<TConfig extends PluginConfig = PluginConfig, TPluginApi extends PluginApi = PluginApi>(pluginFactory: PluginFactory<TConfig, TPluginApi>, eventBus: EventBus, config?: TConfig): IPlugin<TConfig, TPluginApi>;
getViews(): ReadonlyArray<CoreView>;
createView(domEl: HTMLElement, name: string, layoutId?: string): CoreView;
private _isElementIgnored;
assignViewToPlugin<TConfig extends PluginConfig = PluginConfig, TPluginApi extends PluginApi = PluginApi>(view: View, plugin: IPlugin<TConfig, TPluginApi>): void;
getViewsForPlugin<TConfig extends PluginConfig = PluginConfig, TPluginApi extends PluginApi = PluginApi>(plugin: IPlugin<TConfig, TPluginApi>): Array<CoreView>;
getViewsByNameForPlugin<TConfig extends PluginConfig = PluginConfig, TPluginApi extends PluginApi = PluginApi>(plugin: IPlugin<TConfig, TPluginApi>, viewName: string): Array<CoreView>;
Expand Down Expand Up @@ -873,21 +898,14 @@ declare class ViewPropCollection {

declare type ViewPropName = 'position' | 'scale' | 'rotation' | 'size' | 'origin' | 'opacity' | 'borderRadius';

declare type ViewPropNameToElementPropValue = {
[K in ViewPropName]: K extends 'opacity' ? ElementPropValue<number> : K extends 'borderRadius' ? ElementPropValue<BorderRadiusValue> : never;
};

declare interface ViewRect {
viewportOffset: {
left: number;
top: number;
right: number;
bottom: number;
};
pageOffset: {
left: number;
top: number;
};
pageOffset: PageRect;
size: RectSize;
}

Expand Down
Loading

0 comments on commit bcd0c08

Please sign in to comment.