DefineKindOptions<C>: {
    durable?: boolean;
    finish?: ((context: C) => void);
    interfaceGuard?: InterfaceGuard;
    interfaceGuardKit?: InterfaceGuardKit;
    receiveAmplifier?: ReceivePower<Amplify>;
    receiveInstanceTester?: ReceivePower<IsInstance>;
    stateShape?: StateShape;
    thisfulMethods?: boolean;
}

Grab bag of options that can be provided to defineDurableKind and its siblings. Not all options are meaningful in all contexts. See the doc-comments on each option.

Type Parameters

  • C

Type declaration

  • Optionaldurable?: boolean

    As a kind option, intended for internal use only. Meaningful to makeScalarBigMapStore and its siblings. These maker fuctions will make either virtual or durable stores, depending on this flag. Defaults to off, making virtual but not durable collections.

    Generally, durable collections are provided with provideDurableMapStore and its sibling, which use this flag internally. If you do not make durable collections by other means, you can consider this as intended for internal use only.

  • Optionalfinish?: ((context: C) => void)

    If provided, the finish function will be called after the instance is made and internally registered, but before it is returned. The finish function is to do any post-intantiation initialization that should be done before exposing the object to its clients.

      • (context): void
      • Parameters

        • context: C

        Returns void

  • OptionalinterfaceGuard?: InterfaceGuard

    Intended for internal use only. Only applicable if this is a class kind. A class kit kind should use interfaceGuardKit instead.

    If an interfaceGuard is provided, then the raw methods passed alongside it are wrapped by a function that first checks that this method's guard pattern is satisfied before calling the raw method.

    In defineDurableKind and its siblings, this defaults to undefined. Exo classes use this internally to protect their raw class methods using the provided interface. In absence, an exo is protected anyway, while a bare kind is not (detected by !thisfulMethods),

  • OptionalinterfaceGuardKit?: InterfaceGuardKit

    Intended for internal use only. Only applicable if this is a class kit kind. A class kind should use interfaceGuard instead.

    If an interfaceGuardKit is provided, then each member of the interfaceGuardKit is used to guard the corresponding facet of the class kit.

    In defineDurableKindMulti and its siblings, this defaults to undefined. Exo class kits use this internally to protect their facets. In absence, an exo is protected anyway, while a bare kind is not (detected by !thisfulMethods),

  • OptionalreceiveAmplifier?: ReceivePower<Amplify>

    If a receiveAmplifier function is provided to an exo class kit definition, it will be called with an Amplify function. If provided to the definition of a normal exo or exo class, the definition will throw, since only exo kits can be amplified. An Amplify function is a function that takes a facet instance of this class kit as an argument, in which case it will return the facets record, giving access to all the facet instances of the same cohort.

  • OptionalreceiveInstanceTester?: ReceivePower<IsInstance>

    If a receiveInstanceTester function is provided, it will be called during the definition of the exo class or exo class kit with an IsInstance function. The first argument of IsInstance is the value to be tested. When it may be a facet instance of an exo class kit, the optional second argument, if provided, is a facetName. In that case, the function tests only if the first argument is an instance of that facet of the associated exo class kit.

  • OptionalstateShape?: StateShape

    If provided, it describes the shape of all state records of instances of this kind.

  • OptionalthisfulMethods?: boolean

    Intended for internal use only. Should the raw methods receive their context argument as their first argument or as their this binding? For defineDurableKind and its siblings (including prepareSingleton), this defaults to off, meaning that their behavior methods receive context as their first argument. prepareExoClass and its siblings (including prepareExo) use this flag internally to indicate that their methods receive context as their this binding.