Creating Plot Twists
    Preparing search index...

    Type Alias NewActivityOccurrence

    NewActivityOccurrence: Pick<ActivityOccurrence, "occurrence" | "start"> & Partial<
        Omit<ActivityOccurrence, "occurrence" | "start" | "activity" | "tags">,
    > & {
        tags?: NewTags;
        twistTags?: Partial<Record<Tag, boolean>>;
        unread?: boolean;
    }

    Type for creating or updating activity occurrences.

    Follows the same pattern as Activity/NewActivity:

    • Required fields: occurrence (key) and start (for scheduling)
    • Optional fields: All others from ActivityOccurrence
    • Additional fields: twistTags for add/remove, unread for notification control

    Type Declaration

    • Optionaltags?: NewTags

      Tags specific to this occurrence. These replace any recurrence-level tags for this occurrence.

    • OptionaltwistTags?: Partial<Record<Tag, boolean>>

      Add or remove the twist's tags on this occurrence. Maps tag ID to boolean: true = add tag, false = remove tag.

    • Optionalunread?: boolean

      Whether this occurrence should be marked as unread for users.

      • undefined/omitted (default): Occurrence is unread for users, except auto-marked as read for the author if they are the twist owner (user)
      • true: Occurrence is explicitly unread for ALL users (use sparingly)
      • false: Occurrence is marked as read for all users

      For the default behavior, omit this field entirely. Use false for initial sync to avoid marking historical items as unread.

    const activity: NewActivity = {
    type: ActivityType.Event,
    recurrenceRule: "FREQ=WEEKLY;BYDAY=MO",
    occurrences: [
    {
    occurrence: new Date("2025-01-27T14:00:00Z"),
    start: new Date("2025-01-27T14:00:00Z"),
    tags: { [Tag.Skip]: [user] }
    }
    ]
    };