Enode — API Reference
    Preparing search index...
    • The pushable exercise-creation view — a DrawerView hosting the wizard. Push it onto an existing DrawerStack; onClose dismisses (e.g. stack.pop) and onCreated receives the freshly-created exercise so the caller can insert it into a store / auto-select it. onCreated runs side effects only — it must not dismiss; onClose fires straight after it on success.

      onDuplicate is the same contract for an exercise the user already owns: the header offers it the moment the composition matches one in the cached catalogue ("Add existing" / "Open existing", per existingAction), and a create the server rejects as a duplicate lands there too. It receives the EXISTING exercise, and onClose fires straight after. Without a handler the wizard stays open and says the exercise already exists.

      Parameters

      • __namedParameters: {
            allowRm1Entry?: boolean;
            existingAction?: ExistingAction;
            initial?: ExerciseCreateInitial;
            onClose: () => void;
            onCreated?: (exercise: ExerciseMappedReturnDto) => void;
            onDirtyChange?: (dirty: boolean) => void;
            onDuplicate?: (existing: ExerciseMappedReturnDto) => void;
            subtitle?: string;
            title?: string;
            variantOf?: string;
        }
        • OptionalallowRm1Entry?: boolean

          Offer the optional 1RM / PB row on the Name step. Off by default: the caller decides from the signed-in user with mayEnterRm1OnCreate — someone who trains only themselves gets it, a coach does not (for whom the value would be is unclear).

        • OptionalexistingAction?: ExistingAction

          How the host resolves an existing exercise: "add" (a picker — the default, "Create and add" / "Add existing") or "open" (the library — "Create" / "Open existing").

        • Optionalinitial?: ExerciseCreateInitial
        • onClose: () => void
        • OptionalonCreated?: (exercise: ExerciseMappedReturnDto) => void
        • OptionalonDirtyChange?: (dirty: boolean) => void
        • OptionalonDuplicate?: (existing: ExerciseMappedReturnDto) => void
        • Optionalsubtitle?: string

          Line under the title.

        • Optionaltitle?: string

          Header title; defaults to "Create exercise".

        • OptionalvariantOf?: string

          The id of the exercise a new variant starts from. While the composition is still that exercise's own, it is not "already in your library" — the coach just hasn't changed anything yet — so Create waits for a change.

      Returns Element