@mica/sdk (SDK contract v1)
    Preparing search index...

    Function defineAddonService

    MICA-308: an add-on's server half, declared once. defineAddonService is the object an add-on's own FiveM resource hands exports.mica:RegisterService, and the one useService(declaration) types its calls from; addonOutput<T>() attaches an action's answer type and addonError(message) is the refusal a handler answers with. All three are plain functions over plain data out of @mica/shared/addonService, with no state and no I/O, so they bundle into a sandboxed add-on unchanged.

    • Declare an add-on's service. Returns the declaration itself, so the object an author wrote is the one the export carries and the one the UI's types read; throws with the reason when it is not one micaOS would accept, so the mistake surfaces where it was made rather than as an invalid_args from the export.

      Deep-frozen. The id is traced from this literal (the SDK's permissions scan reads it), so nothing may change it afterwards: journal.id = 'other' throws in strict mode and does nothing otherwise, and so does any write to an action or a field.

      Type Parameters

      Parameters

      • declaration: D

      Returns D