Options
All
  • Public
  • Public/Protected
  • All
Menu

Library @swim/view

@swim/view

package documentation chat

@swim/view provides a unified HTML, SVG, and Canvas view hierarchy, with integrated controller architecture, animated procedural styling, and constraint-based layouts. @swim/view is part of the @swim/ui framework.

Installation

npm

For an npm-managed project, npm install @swim/view to make it a dependency. TypeScript sources will be installed into node_modules/@swim/view/main. Transpiled JavaScript and TypeScript definition files install into node_modules/@swim/view/lib/main. And a pre-built UMD script can be found in node_modules/@swim/view/dist/main/swim-view.js.

Browser

Browser applications can load swim-ui.js—which bundles the @swim/view library—along with its swim-core.js dependency, directly from the SwimOS CDN.

<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-core.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-ui.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-core.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-ui.min.js"></script>

Alternatively, the swim-toolkit.js script may be loaded, along with its swim-system.js dependency, from the SwimOS CDN. The swim-toolkit.js script bundles @swim/view together with all other @swim/toolkit frameworks.

<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-system.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-toolkit.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-system.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-toolkit.min.js"></script>

Usage

ES6/TypeScript

@swim/view can be imported as an ES6 module from TypeScript and other ES6-compatible environments.

import * as view from "@swim/view";

CommonJS/Node.js

@swim/view can also be used as a CommonJS module in Node.js applications.

var view = require("@swim/view");

Browser

When loaded by a web browser, the swim-ui.js script adds all @swim/view library exports to the global swim namespace. The swim-ui.js script requires that swim-core.js has already been loaded.

The swim-toolkit.js script also adds all @swim/view library exports to the global swim namespace, making it a drop-in replacement for swim-ui.js and swim-view.js when additional @swim/toolkit frameworks are needed.

Index

Classes

Interfaces

Type aliases

Variables

Type aliases

AnimatorFlags

AnimatorFlags: number

GestureInputType

GestureInputType: "mouse" | "wheel" | "touch" | "pen" | "unknown"

ModalState

ModalState: "hidden" | "showing" | "shown" | "hiding"

MomentumGesture

MomentumGesture<V>: AbstractMomentumGesture<V>

Type parameters

PositionGesture

PositionGesture<V>: AbstractPositionGesture<V>

Type parameters

ScaleGesture

ScaleGesture<X, Y, V>: AbstractScaleGesture<X, Y, V>

Type parameters

ViewAnimatorConstraintDescriptor

ViewAnimatorConstraintDescriptor<V, T, U, I>: ViewAnimatorConstraintInit<T, U> & ThisType<ViewAnimatorConstraint<V, T, U> & I> & Partial<I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewAnimatorConstraintDescriptorExtends

ViewAnimatorConstraintDescriptorExtends<V, T, U, I>: { extends: ViewAnimatorConstraintClass | undefined } & ViewAnimatorConstraintDescriptor<V, T, U, I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewAnimatorConstraintDescriptorFromAny

ViewAnimatorConstraintDescriptorFromAny<V, T, U, I>: { type: FromAny<T, U> } | { fromAny: any } & ViewAnimatorConstraintDescriptor<V, T, U, I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewAnimatorDescriptor

ViewAnimatorDescriptor<V, T, U, I>: ViewAnimatorInit<T, U> & ThisType<ViewAnimator<V, T, U> & I> & Partial<I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewAnimatorDescriptorExtends

ViewAnimatorDescriptorExtends<V, T, U, I>: { extends: ViewAnimatorClass | undefined } & ViewAnimatorDescriptor<V, T, U, I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewAnimatorDescriptorFromAny

ViewAnimatorDescriptorFromAny<V, T, U, I>: { type: FromAny<T, U> } | { fromAny: any } & ViewAnimatorDescriptor<V, T, U, I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewAnimatorMemberInit

ViewAnimatorMemberInit<V, K>: V[K] extends ViewAnimator<any, infer T, infer U> ? T | U : never

Type parameters

  • V

  • K: keyof V

ViewAnimatorMemberKey

ViewAnimatorMemberKey<V, K>: V[K] extends ViewAnimator<any, any> ? K : never

Type parameters

  • V

  • K: keyof V

ViewAnimatorMemberMap

ViewAnimatorMemberMap<V>: {-readonly [ K in keyof V as ViewAnimatorMemberKey<V, K>]-?: ViewAnimatorMemberInit<V, K> }

Type parameters

  • V

ViewAnimatorMemberType

ViewAnimatorMemberType<V, K>: V[K] extends ViewAnimator<any, infer T, any> ? T : never

Type parameters

  • V

  • K: keyof V

ViewColorScheme

ViewColorScheme: "dark" | "light" | "no-preference"

ViewContextType

ViewContextType<V>: V extends { viewContext: infer VC } ? VC : unknown

Type parameters

ViewControllerType

ViewControllerType<V>: V extends { viewController: infer VC | null } ? VC : never

Type parameters

ViewFastenerDescriptor

ViewFastenerDescriptor<V, S, U, I>: ViewFastenerInit<S, U> & ThisType<ViewFastener<V, S, U> & I> & Partial<I>

Type parameters

ViewFastenerFlags

ViewFastenerFlags: number

ViewFastenerMemberInit

ViewFastenerMemberInit<V, K>: V[K] extends ViewFastener<any, infer S, infer U> ? S | U : never

Type parameters

  • V

  • K: keyof V

ViewFastenerMemberType

ViewFastenerMemberType<V, K>: V[K] extends ViewFastener<any, infer S, any> ? S : never

Type parameters

  • V

  • K: keyof V

ViewFlags

ViewFlags: number

ViewIdiom

ViewIdiom: "unspecified" | "mobile" | "tablet" | "desktop"

ViewManagerObserverType

ViewManagerObserverType<VM>: VM extends { viewManagerObservers: ReadonlyArray<infer VMO> } ? VMO : never

Type parameters

ViewMemberInit

ViewMemberInit<V, K>: V[K] extends ViewProperty<any, infer T, infer U> ? T | U : V[K] extends ViewAnimator<any, infer T, infer U> ? T | U : never

Type parameters

  • V

  • K: keyof V

ViewMemberKey

ViewMemberKey<V, K>: V[K] extends ViewProperty<any, any> ? K : V[K] extends ViewAnimator<any, any> ? K : never

Type parameters

  • V

  • K: keyof V

ViewMemberMap

ViewMemberMap<V>: {-readonly [ K in keyof V as ViewMemberKey<V, K>]-?: ViewMemberInit<V, K> }

Type parameters

  • V

ViewMemberType

ViewMemberType<V, K>: V[K] extends ViewProperty<any, infer T, any> ? T : V[K] extends ViewAnimator<any, infer T, any> ? T : never

Type parameters

  • V

  • K: keyof V

ViewObserverType

ViewObserverType<V>: V extends { viewObservers: ReadonlyArray<infer VO> } ? VO : never

Type parameters

ViewPrecedence

ViewPrecedence: number

ViewPropertyConstraintDescriptor

ViewPropertyConstraintDescriptor<V, T, U, I>: ViewPropertyConstraintInit<T, U> & ThisType<ViewPropertyConstraint<V, T, U> & I> & Partial<I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewPropertyConstraintDescriptorExtends

ViewPropertyConstraintDescriptorExtends<V, T, U, I>: { extends: ViewPropertyConstraintClass | undefined } & ViewPropertyConstraintDescriptor<V, T, U, I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewPropertyConstraintDescriptorFromAny

ViewPropertyConstraintDescriptorFromAny<V, T, U, I>: { type: FromAny<T, U> } | { fromAny: any } & ViewPropertyConstraintDescriptor<V, T, U, I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewPropertyDescriptor

ViewPropertyDescriptor<V, T, U, I>: ViewPropertyInit<T, U> & ThisType<ViewProperty<V, T, U> & I> & Partial<I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewPropertyDescriptorExtends

ViewPropertyDescriptorExtends<V, T, U, I>: { extends: ViewPropertyClass | undefined } & ViewPropertyDescriptor<V, T, U, I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewPropertyDescriptorFromAny

ViewPropertyDescriptorFromAny<V, T, U, I>: { type: FromAny<T, U> } | { fromAny: any } & ViewPropertyDescriptor<V, T, U, I>

Type parameters

  • V: View

  • T

  • U = never

  • I = {}

ViewPropertyFlags

ViewPropertyFlags: number

ViewPropertyMemberInit

ViewPropertyMemberInit<V, K>: V[K] extends ViewProperty<any, infer T, infer U> ? T | U : never

Type parameters

  • V

  • K: keyof V

ViewPropertyMemberKey

ViewPropertyMemberKey<V, K>: V[K] extends ViewProperty<any, any> ? K : never

Type parameters

  • V

  • K: keyof V

ViewPropertyMemberMap

ViewPropertyMemberMap<V>: {-readonly [ K in keyof V as ViewPropertyMemberKey<V, K>]-?: ViewPropertyMemberInit<V, K> }

Type parameters

  • V

ViewPropertyMemberType

ViewPropertyMemberType<V, K>: V[K] extends ViewProperty<any, infer T, any> ? T : never

Type parameters

  • V

  • K: keyof V

ViewServiceDescriptor

ViewServiceDescriptor<V, T, I>: ViewServiceInit<T> & ThisType<ViewService<V, T> & I> & Partial<I>

Type parameters

ViewServiceDescriptorExtends

ViewServiceDescriptorExtends<V, T, I>: { extends: ViewServiceClass | undefined } & ViewServiceDescriptor<V, T, I>

Type parameters

ViewServiceFlags

ViewServiceFlags: number

ViewServiceMemberType

ViewServiceMemberType<V, K>: V[K] extends ViewService<any, infer T> ? T : never

Type parameters

  • V

  • K: keyof V

Variables

Modal

Modal: { is: any }

Type declaration

  • is: function
    • is(object: unknown): object is Modal
    • Parameters

      • object: unknown

      Returns object is Modal

MomentumGesture

MomentumGesture: typeof AbstractMomentumGesture

PositionGesture

PositionGesture: typeof AbstractPositionGesture

ScaleGesture

ScaleGesture: typeof AbstractScaleGesture

ViewAnimator

ViewAnimator: { prototype: ViewAnimator<any, any, never>; define: any; getClass: any }

Type declaration

    • Type parameters

      Parameters

      Returns PropertyDecorator

    • Type parameters

      Parameters

      Returns PropertyDecorator

    • Type parameters

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_3: View<V_3>

      • T_3: undefined | null | Font = undefined | null | Font

      • U_3: undefined | null | AnyFont = undefined | null | AnyFont

      Parameters

      Returns PropertyDecorator

    • Type parameters

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_5: View<V_5>

      • T_5: undefined | null | string = undefined | null | string

      • U_5: undefined | null | string = undefined | null | string

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_6: View<V_6>

      • T_6: undefined | null | boolean = undefined | null | boolean

      • U_6: undefined | null | string | boolean = undefined | null | string | boolean

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_7: View<V_7>

      • T_7: undefined | null | number = undefined | null | number

      • U_7: undefined | null | string | number = undefined | null | string | number

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_8: View<V_8>

      • T_8

      • U_8 = never

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_9: View<V_9>

      • T_9

      • U_9 = never

      • I = {}

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_10: View<V_10>

      • T_10

      • U_10 = never

      Parameters

      Returns PropertyDecorator

  • prototype: ViewAnimator<any, any, never>
  • define: function
    • Type parameters

      • V_12: View<V_12>

      • T_12

      • U_12 = never

      • I_1 = {}

      Parameters

      Returns ViewAnimatorConstructor<V_12, T_12, U_12, I_1>

    • Type parameters

      • V_13: View<V_13>

      • T_13

      • U_13 = never

      Parameters

      Returns ViewAnimatorConstructor<V_13, T_13, U_13, {}>

  • getClass: function
    • Parameters

      • type: unknown

      Returns null | ViewAnimatorClass

ViewAnimatorConstraint

ViewAnimatorConstraint: { prototype: ViewAnimatorConstraint<any, any, never>; define: any; getClass: any }

Type declaration

ViewContext

ViewContext: { default: any }

Type declaration

  • default: function
    • Returns ViewContext

ViewFastener

ViewFastener: { MountedFlag: number; prototype: ViewFastener<any, any, never>; define: any }

Type declaration

ViewProperty

ViewProperty: { ConstrainedFlag: number; ConstrainingFlag: number; InheritedFlag: number; MountedFlag: number; OverrideFlag: number; UpdatedFlag: number; prototype: ViewProperty<any, any, never>; define: any; getClass: any }

Type declaration

    • Type parameters

      • V: View<V>

      • T: undefined | string = undefined | string

      • U: undefined | string = undefined | string

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_1: View<V_1>

      • T_1: undefined | boolean = undefined | boolean

      • U_1: undefined | string | boolean = undefined | string | boolean

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_2: View<V_2>

      • T_2: undefined | number = undefined | number

      • U_2: undefined | string | number = undefined | string | number

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_3: View<V_3>

      • T_3

      • U_3 = never

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_4: View<V_4>

      • T_4

      • U_4 = never

      • I = {}

      Parameters

      Returns PropertyDecorator

    • Type parameters

      • V_5: View<V_5>

      • T_5

      • U_5 = never

      Parameters

      Returns PropertyDecorator

  • ConstrainedFlag: number
  • ConstrainingFlag: number
  • InheritedFlag: number
  • MountedFlag: number
  • OverrideFlag: number
  • UpdatedFlag: number
  • prototype: ViewProperty<any, any, never>
  • define: function
  • getClass: function
    • Parameters

      • type: unknown

      Returns null | ViewPropertyClass

ViewPropertyConstraint

ViewPropertyConstraint: { prototype: ViewPropertyConstraint<any, any, never>; define: any; getClass: any }

Type declaration

ViewService

ViewService: { InheritedFlag: number; prototype: ViewService<any, any>; define: any; getClass: any }

Type declaration

Viewport

Viewport: { detect: any }

Type declaration

  • detect: function
    • Returns Viewport

Generated using TypeDoc