@nevware21/ts-utils
    Preparing search index...

    Type Alias ProxyFunctionDef<T, H>

    Describes how a single function from a host object H should be proxied onto a target object T. Used as an element of the funcDefs array passed to createProxyFuncs.

    0.9.8

    interface Host { greet(): string; farewell(): string; }
    interface Target { hello?(): string; farewell?(): string; }

    const defs: ProxyFunctionDef<Target, Host>[] = [
    { n: "greet", as: "hello" }, // host.greet → target.hello
    { n: "farewell" }, // host.farewell → target.farewell
    ];
    type ProxyFunctionDef<T, H> = {
        as?: TypeFuncNames<T>;
        n: TypeFuncNames<H>;
        rp?: boolean;
    }

    Type Parameters

    • T

      The target object type that will receive the proxied function.

    • H

      The host object type that owns the original function.

    Index

    Properties

    Properties

    Use this name on the target for the proxied function. Defaults to the same name as the host function when not defined.

    Identifies the host function name to proxy.

    rp?: boolean

    When false (the default) an existing function on the target will not be replaced. Set to true to always overwrite.