@runic-artifex/vue

Version 0.7.0-preview.5. Read from the published package.

@runic-artifex/vue

CollectionViewport re-export
export { CollectionViewport } from '@runic-artifex/views'

Re-exported from CollectionViewport.

CollectionViewportHandle interface
CollectionViewportOptions re-export
export { CollectionViewportOptions } from '@runic-artifex/views'

Re-exported from CollectionViewportOptions.

CommandHandle interface
useCollectionViewport function
function useCollectionViewport(options: MaybeRefOrGetter<CollectionViewportOptions>): CollectionViewportHandle;

Follows a fixed-row-height scroll container and returns the rows to request from .NET. Pass a getter such as () => ({ totalCount: state.value?.totalCount ?? 0, rowHeight: 32 }) and watch viewport to send start and size to the ViewModel.

useCommand function
function useCommand<TArgs extends readonly unknown[], TReturn>(command: (...args: TArgs) => TReturn): CommandHandle<TArgs, Awaited<TReturn>>;

Tracks a command's pending state and failure. The result is a reactive object, so templates read increment.pending directly; do not destructure pending, error or failure. ```vue const increment = useCommand(() => client.value?.increment()); <button :disabled="!client || increment.pending"

useView function
function useView<TClient extends ViewClient>(source: MaybeRefOrGetter<ViewSource<TClient>>): ViewHandle<TClient>;

Connects a generated View reference while the current effect scope (for example a component) is active and exposes its state as shallow refs. A changed reference disposes the previous client; disposing the scope disposes the current one. Pass a getter such as () => props.page to follow a prop. A reference is identified by its connect function, so a getter returning a new { connect: connectWorkspace } object does not reconnect.

ViewClient re-export
export { ViewClient } from '@runic-artifex/views'

Re-exported from ViewClient.

ViewConnector re-export
export { ViewConnector } from '@runic-artifex/views'

Re-exported from ViewConnector.

ViewHandle interface
ViewOutlet constant
const ViewOutlet: new <R extends ViewReference>(props: (ViewOutletProps<R> & ({
    [x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
} | {
    [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
})) & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps) => import("vue").CreateComponentPublicInstanceWithMixins<ViewOutletProps<R> & ({
    [x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
} | {
    [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
}), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, import("vue").PublicProps, {}, false, {}, {}, {}, {}, string, {}, any, import("vue").ComponentProvideOptions, {
    P: {};
    B: {};
    D: {};
    C: {};
    M: {};
    Defaults: {};
}, (ViewOutletProps<R> & {
    [x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
}) | (ViewOutletProps<R> & {
    [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
}), {}, {}, {}, {}, {}>;

Renders the registered component for a generated View reference and passes the reference as its page prop. A different reference remounts the component. A kind without a component renders an alert; the default slot renders while there is no content.

ViewOutletProps interface
ViewReference re-export
export { ViewReference } from '@runic-artifex/views'

Re-exported from ViewReference.

ViewRegistry type alias
type ViewRegistry<R extends ViewReference> = {
    readonly [K in R["kind"]]: Component<{
        page: Extract<R, {
            readonly kind: K;
        }>;
    }>;
};

A build-known map checks each generated reference kind against its component's page prop.

ViewSource re-export
export { ViewSource } from '@runic-artifex/views'

Re-exported from ViewSource.