Dex TypeScript SDK 1.35.0
    Preparing search index...

    Type Alias RPCMethodName<FlowType>

    RPCMethodName: Exclude<
        {
            [Name in keyof FlowType]-?: FlowType[Name] extends (
                ...args: infer Parameters,
            ) => unknown
                ? Parameters extends []
                    ? never
                    : Context extends Parameters[0] ? Name : never
                : never
        }[keyof FlowType],
        "handleTimeout",
    > & string

    Selects the public method names of a Flow type that can receive Context as their first argument.

    declareRPCMethod uses this type so its method name argument is checked at compile time. A method qualifies when Context is assignable to its first parameter. declareRPCMethod also requires at least one parameter; this rule is stricter than @rpc, which accepts methods with no parameters. Private and protected methods are not included, so declare RPC methods as public. The Flow timeout handler handleTimeout is excluded.

    The type also accepts inherited method names. declareRPCMethod rejects them at runtime; declare an inherited method through the class that defines it.

    A call without these types, such as from JavaScript, is not checked at compile time. At runtime declareRPCMethod rejects handleTimeout but no other Flow interface method, such as getFlowType.

    Type Parameters

    • FlowType

      Flow instance type that declares the RPC method.