Options
All
  • Public
  • Public/Protected
  • All
Menu

Library @swim/component

@swim/component

package documentation chat

@swim/component provides componentized controller layer with application lifecycle and service management. @swim/component is part of the @swim/ui framework.

Installation

npm

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

Browser

Browser applications can load swim-ui.js—which bundles the @swim/component library—along with its swim-core.js and swim-mesh.js dependencies, 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-mesh.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-mesh.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/component 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/component can be imported as an ES6 module from TypeScript and other ES6-compatible environments.

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

CommonJS/Node.js

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

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

Browser

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

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

Index

Classes

Interfaces

Type aliases

Variables

Type aliases

ComponentContextType

ComponentContextType<C>: C extends { componentContext: infer C } ? C : unknown

Type parameters

ComponentFastenerDescriptor

ComponentFastenerDescriptor<C, S, U, I>: ComponentFastenerInit<S, U> & ThisType<ComponentFastener<C, S, U> & I> & Partial<I>

Type parameters

ComponentFastenerFlags

ComponentFastenerFlags: number

ComponentFastenerMemberInit

ComponentFastenerMemberInit<C, K>: C[K] extends ComponentFastener<any, infer T, infer U> ? T | U : never

Type parameters

  • C

  • K: keyof C

ComponentFastenerMemberType

ComponentFastenerMemberType<C, K>: C[K] extends ComponentFastener<any, infer S, any> ? S : never

Type parameters

  • C

  • K: keyof C

ComponentFlags

ComponentFlags: number

ComponentManagerObserverType

ComponentManagerObserverType<CM>: CM extends { componentManagerObservers: ReadonlyArray<infer CMO> } ? CMO : never

Type parameters

ComponentModelDescriptor

ComponentModelDescriptor<C, M, U, I>: ComponentModelInit<M, U> & ThisType<ComponentModel<C, M, U> & I> & Partial<I>

Type parameters

ComponentModelFlags

ComponentModelFlags: number

ComponentModelMemberInit

ComponentModelMemberInit<C, K>: C[K] extends ComponentModel<any, infer M, infer U> ? M | U : never

Type parameters

  • C

  • K: keyof C

ComponentModelMemberType

ComponentModelMemberType<C, K>: C[K] extends ComponentModel<any, infer M, any> ? M : never

Type parameters

  • C

  • K: keyof C

ComponentObserverType

ComponentObserverType<C>: C extends { componentObservers: ReadonlyArray<infer CO> } ? CO : never

Type parameters

ComponentPrecedence

ComponentPrecedence: number

ComponentPropertyDescriptor

ComponentPropertyDescriptor<C, T, U, I>: ComponentPropertyInit<T, U> & ThisType<ComponentProperty<C, T, U> & I> & Partial<I>

Type parameters

ComponentPropertyDescriptorExtends

ComponentPropertyDescriptorExtends<C, T, U, I>: { extends: ComponentPropertyClass | undefined } & ComponentPropertyDescriptor<C, T, U, I>

Type parameters

ComponentPropertyDescriptorFromAny

ComponentPropertyDescriptorFromAny<C, T, U, I>: { type: FromAny<T, U> } | { fromAny: any } & ComponentPropertyDescriptor<C, T, U, I>

Type parameters

ComponentPropertyFlags

ComponentPropertyFlags: number

ComponentPropertyMemberInit

ComponentPropertyMemberInit<C, K>: C[K] extends ComponentProperty<any, infer T, infer U> ? T | U : never

Type parameters

  • C

  • K: keyof C

ComponentPropertyMemberKey

ComponentPropertyMemberKey<C, K>: C[K] extends ComponentProperty<any, any> ? K : never

Type parameters

  • C

  • K: keyof C

ComponentPropertyMemberMap

ComponentPropertyMemberMap<C>: {-readonly [ K in keyof C as ComponentPropertyMemberKey<C, K>]-?: ComponentPropertyMemberInit<C, K> }

Type parameters

  • C

ComponentPropertyMemberType

ComponentPropertyMemberType<C, K>: C[K] extends ComponentProperty<any, infer T, any> ? T : never

Type parameters

  • C

  • K: keyof C

ComponentServiceDescriptor

ComponentServiceDescriptor<C, T, I>: ComponentServiceInit<T> & ThisType<ComponentService<C, T> & I> & Partial<I>

Type parameters

ComponentServiceDescriptorExtends

ComponentServiceDescriptorExtends<C, T, I>: { extends: ComponentServiceClass | undefined } & ComponentServiceDescriptor<C, T, I>

Type parameters

ComponentServiceFlags

ComponentServiceFlags: number

ComponentServiceMemberType

ComponentServiceMemberType<C, K>: C[K] extends ComponentService<any, infer T> ? T : never

Type parameters

  • C

  • K: keyof C

ComponentTraitDescriptor

ComponentTraitDescriptor<C, R, U, I>: ComponentTraitInit<R, U> & ThisType<ComponentTrait<C, R, U> & I> & Partial<I>

Type parameters

ComponentTraitFlags

ComponentTraitFlags: number

ComponentTraitMemberInit

ComponentTraitMemberInit<C, K>: C[K] extends ComponentTrait<any, infer R, infer U> ? R | U : never

Type parameters

  • C

  • K: keyof C

ComponentTraitMemberType

ComponentTraitMemberType<C, K>: C[K] extends ComponentTrait<any, infer R, any> ? R : never

Type parameters

  • C

  • K: keyof C

ComponentViewDescriptor

ComponentViewDescriptor<C, V, U, I>: ComponentViewInit<V, U> & ThisType<ComponentView<C, V, U> & I> & Partial<I>

Type parameters

ComponentViewFlags

ComponentViewFlags: number

ComponentViewMemberInit

ComponentViewMemberInit<C, K>: C[K] extends ComponentView<any, infer V, infer U> ? V | U : never

Type parameters

  • C

  • K: keyof C

ComponentViewMemberType

ComponentViewMemberType<C, K>: C[K] extends ComponentView<any, infer V, any> ? V : never

Type parameters

  • C

  • K: keyof C

ComponentViewTraitDescriptor

ComponentViewTraitDescriptor<C, V, R, VU, RU, I>: ComponentViewTraitInit<V, R, VU, RU> & ThisType<ComponentViewTrait<C, V, R, VU, RU> & I> & Partial<I>

Type parameters

ComponentViewTraitFlags

ComponentViewTraitFlags: number

Variables

ComponentContext

ComponentContext: { default: any }

Type declaration

ComponentFastener

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

Type declaration

ComponentModel

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

Type declaration

ComponentProperty

ComponentProperty: { InheritedFlag: number; MountedFlag: number; OverrideFlag: number; UpdatedFlag: number; prototype: ComponentProperty<any, any, never>; define: any; getConstructor: any }

Type declaration

ComponentService

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

Type declaration

ComponentTrait

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

Type declaration

ComponentView

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

Type declaration

ComponentViewTrait

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

Type declaration

HistoryState

HistoryState: { cloned: any; current: any; empty: any; fromUri: any; fromUriFragment: any; toUri: any; updated: any }

Type declaration

Generated using TypeDoc