@hmiproject/helio-sdk
    Preparing search index...

    Function createAction

    • Creates a HELIO Action.

      Actions can perform side effects on user actions.

      Note: New actions need to be added to the extension's library (see createLibraryExtension) to become active in HELIO.

      Type Parameters

      Parameters

      • namespace: Namespace
      • options: {
            category?: string;
            description?: string;
            icon?: IconRef;
            id?: string;
            name: string;
            propsSchema: Schema;
            useAction: (
                props: CurrentSchemaValues<Schema>,
            ) => CreateActionUseActionResult;
        }
        • Optionalcategory?: string

          Optional category for grouping this action in the HELIO IDE, such as in the Add Element dialog.

        • Optionaldescription?: string

          Description of this action that will appear in the IDE.

        • Optionalicon?: IconRef

          Optional icon to identify this action in the HELIO IDE.

          { name: 'Dinosaur' }
          
        • Optionalid?: string

          Internal ID of the action. This uniquely identifies the action within the extension and should never change. If this property is omitted, the action will be referenced by its name.

        • name: string

          Human-readable name of the action as it will appear in the HELIO IDE.

          Note: If no explicit id is provided, this value will also be used to create a unique id for the action.

          Changing the name in an extension update will break action references in existing projects.

          If you need to change the name, make sure to provide an id with the old name to ensure a smooth migration.

          Migrating action name.

          {
          name: 'New Action Name',
          id: 'Old Action Name',
          // ...other `createAction` options...
          }
        • propsSchema: Schema

          Schema containing the properties this action accepts, created using the createPropsSchema function.

        • useAction: (props: CurrentSchemaValues<Schema>) => CreateActionUseActionResult

          Implementation of this action property.

          Will be dynamically installed by HELIO as a React hook to allow for data subscription and other scenarios where data changes over time.

      Returns CreateActionResult<Schema>

      1.0.0