@overmap-ai/core 1.0.43-projects-licensing.4 → 1.0.43-tiptap.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,39 @@
1
1
  import { BaseApiService } from "./BaseApiService";
2
- import type { OptimisticGenericResult, OptimisticModelResult, OptimisticMultipleModelResult } from "../typings";
3
- import { IssueAttachment, MaybeObjectURL, PhotoAttachmentPayload } from "../../typings";
2
+ import type { OptimisticModelResult } from "../typings";
3
+ import { ComponentAttachment, ComponentTypeAttachment, Created, IssueAttachment, MaybeObjectURL, AttachmentPayload, Stored } from "../../typings";
4
4
  /**
5
5
  * Handles creation and caching of attachments
6
6
  */
7
+ interface StoredAttachments {
8
+ issue_attachments: Stored<IssueAttachment>[];
9
+ component_attachments: Stored<ComponentAttachment>[];
10
+ component_type_attachments: Stored<ComponentTypeAttachment>[];
11
+ }
12
+ interface CreatedAttachments {
13
+ issue_attachments: Created<IssueAttachment>[];
14
+ component_attachments: Created<ComponentAttachment>[];
15
+ component_type_attachments: Created<ComponentTypeAttachment>[];
16
+ }
7
17
  export declare class AttachmentService extends BaseApiService {
8
- fetchAll(projectId: number): OptimisticMultipleModelResult<IssueAttachment>;
9
- add(attachmentPayload: PhotoAttachmentPayload): Promise<OptimisticModelResult<IssueAttachment>>;
10
- attachFilesToIssue(filesToSubmit: File[], issueId: string): Promise<PromiseSettledResult<OptimisticGenericResult<IssueAttachment>>[]>;
11
- replaceFile(attachmentId: string, newFile: MaybeObjectURL<File>): Promise<OptimisticModelResult<IssueAttachment>>;
18
+ fetchAll(projectId: number): [StoredAttachments, Promise<CreatedAttachments>];
19
+ addIssueAttachment(attachmentPayload: AttachmentPayload<IssueAttachment>): Promise<OptimisticModelResult<IssueAttachment>>;
20
+ addComponentAttachment(attachmentPayload: AttachmentPayload<ComponentAttachment>): Promise<OptimisticModelResult<ComponentAttachment>>;
21
+ addComponentTypeAttachment(attachmentPayload: AttachmentPayload<ComponentTypeAttachment>): Promise<OptimisticModelResult<ComponentTypeAttachment>>;
22
+ /** the outer Promise is needed to await the hashing of each file, which is required before offline use. If wanting to
23
+ * attach promise handlers to the request to add the attachment in the backend, apply it on the promise returned from the
24
+ * OptimisticModelResult. */
25
+ attachFilesToIssue(filesToSubmit: File[], issueId: string): Promise<OptimisticModelResult<IssueAttachment>>[];
26
+ attachFilesToComponent(filesToSubmit: File[], componentId: string): Promise<OptimisticModelResult<ComponentAttachment>>[];
27
+ attachFilesToComponentType(filesToSubmit: File[], componentTypeId: string): Promise<OptimisticModelResult<ComponentTypeAttachment>>[];
28
+ replaceIssueAttachmentFile(attachmentId: string, newFile: MaybeObjectURL<File>): Promise<OptimisticModelResult<IssueAttachment>>;
29
+ replaceComponentAttachmentFile(attachmentId: string, newFile: MaybeObjectURL<File>): Promise<OptimisticModelResult<ComponentAttachment>>;
30
+ replaceComponentTypeAttachmentFile(attachmentId: string, newFile: MaybeObjectURL<File>): Promise<OptimisticModelResult<ComponentTypeAttachment>>;
12
31
  /**
13
32
  * Deletes an attachment and associated data in the cloud, in the Redux store and the cache.
14
- * @param attachmentId
33
+ * @param issueAttachmentId
15
34
  */
16
- delete(attachmentId: string): Promise<undefined>;
35
+ deleteIssueAttachment(issueAttachmentId: string): Promise<undefined>;
36
+ deleteComponentAttachment(componentAttachmentId: string): Promise<undefined>;
37
+ deleteComponentTypeAttachment(componentTypeAttachmentId: string): Promise<undefined>;
17
38
  }
39
+ export {};
@@ -1,7 +1,8 @@
1
1
  import { PayloadAction, Reducer } from "@reduxjs/toolkit";
2
- import { Component, ComponentType, RootState, Selector, SelectorWithArgs, Submitted } from "../../typings";
2
+ import { Component, ComponentAttachment, ComponentType, RootState, Selector, SelectorWithArgs, Stored, Submitted } from "../../typings";
3
3
  export interface ComponentState {
4
4
  components: Record<string, Component | Submitted<Component>>;
5
+ attachments: Record<string, Stored<ComponentAttachment>>;
5
6
  }
6
7
  export declare const componentSlice: import("@reduxjs/toolkit").Slice<ComponentState, {
7
8
  addComponent: (state: import("immer/dist/internal.js").WritableDraft<ComponentState>, action: {
@@ -13,6 +14,30 @@ export declare const componentSlice: import("@reduxjs/toolkit").Slice<ComponentS
13
14
  setComponents: (state: import("immer/dist/internal.js").WritableDraft<ComponentState>, action: {
14
15
  payload: Component[];
15
16
  }) => void;
17
+ setComponentAttachments: (state: ComponentState, action: {
18
+ payload: import('../../typings/models/issues.ts').Created<ComponentAttachment>[];
19
+ type: string;
20
+ }) => void;
21
+ addComponentAttachment: (state: ComponentState, action: {
22
+ payload: Submitted<ComponentAttachment>;
23
+ type: string;
24
+ }) => void;
25
+ addComponentAttachments: (state: ComponentState, action: {
26
+ payload: Submitted<ComponentAttachment>[];
27
+ type: string;
28
+ }) => void;
29
+ updateComponentAttachment: (state: ComponentState, action: {
30
+ payload: Submitted<ComponentAttachment>;
31
+ type: string;
32
+ }) => void;
33
+ removeComponentAttachment: (state: ComponentState, action: {
34
+ payload: string;
35
+ type: string;
36
+ }) => void;
37
+ removeComponentAttachments: (state: ComponentState, action: {
38
+ payload: string[];
39
+ type: string;
40
+ }) => void;
16
41
  updateComponent: (state: import("immer/dist/internal.js").WritableDraft<ComponentState>, action: {
17
42
  payload: Component;
18
43
  }) => void;
@@ -27,5 +52,12 @@ export declare const selectComponentTypeFromComponents: Selector<Record<string,
27
52
  export declare const selectComponentsByType: SelectorWithArgs<string, Component[]>;
28
53
  export declare const selectNumberOfComponentsOfComponentType: SelectorWithArgs<string | undefined, number>;
29
54
  export declare const selectComponentTypesFromIds: SelectorWithArgs<string[], ComponentType[]>;
30
- export declare const addComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<Component, "components/addComponent">, updateComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<Component, "components/updateComponent">, removeComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "components/removeComponent">, addComponentsInBatches: import("@reduxjs/toolkit").ActionCreatorWithPayload<(Component | Submitted<Component>)[], "components/addComponentsInBatches">, setComponents: import("@reduxjs/toolkit").ActionCreatorWithPayload<Component[], "components/setComponents">, removeAllComponentsOfType: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "components/removeAllComponentsOfType">;
55
+ export declare const selectComponentAttachmentMapping: (state: RootState) => Record<string, Stored<ComponentAttachment>>;
56
+ export declare const selectAllComponentAttachments: Selector<Stored<ComponentAttachment>[]>;
57
+ export declare const selectAttachmentsOfComponent: (args: string) => (state: RootState) => Stored<ComponentAttachment>[];
58
+ export declare const selectAttachmentsOfComponentByType: (args: string) => (state: RootState) => {
59
+ fileAttachments: Stored<ComponentAttachment>[];
60
+ imageAttachments: Stored<ComponentAttachment>[];
61
+ };
62
+ export declare const addComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<Component, "components/addComponent">, updateComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<Component, "components/updateComponent">, removeComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "components/removeComponent">, addComponentsInBatches: import("@reduxjs/toolkit").ActionCreatorWithPayload<(Component | Submitted<Component>)[], "components/addComponentsInBatches">, setComponents: import("@reduxjs/toolkit").ActionCreatorWithPayload<Component[], "components/setComponents">, setComponentAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<import('../../typings/models/issues.ts').Created<ComponentAttachment>[], "components/setComponentAttachments">, addComponentAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<ComponentAttachment>, "components/addComponentAttachment">, addComponentAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<ComponentAttachment>[], "components/addComponentAttachments">, updateComponentAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<ComponentAttachment>, "components/updateComponentAttachment">, removeComponentAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "components/removeComponentAttachment">, removeComponentAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "components/removeComponentAttachments">, removeAllComponentsOfType: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "components/removeAllComponentsOfType">;
31
63
  export declare const componentReducer: Reducer<ComponentState>;
@@ -1,8 +1,9 @@
1
1
  import type { Reducer } from "@reduxjs/toolkit";
2
- import type { ComponentType, RootState, SelectorWithArgs } from "../../typings";
2
+ import type { ComponentType, ComponentTypeAttachment, RootState, Selector, SelectorWithArgs, Stored } from "../../typings";
3
3
  export interface ComponentTypeState {
4
4
  componentTypes: Record<string, ComponentType>;
5
5
  hiddenComponentTypeIds: Record<string, boolean>;
6
+ attachments: Record<string, ComponentTypeAttachment>;
6
7
  }
7
8
  export declare const componentTypeSlice: import("@reduxjs/toolkit").Slice<ComponentTypeState, {
8
9
  addComponentType: (state: import("immer/dist/internal.js").WritableDraft<ComponentTypeState>, action: {
@@ -11,6 +12,30 @@ export declare const componentTypeSlice: import("@reduxjs/toolkit").Slice<Compon
11
12
  setComponentTypes: (state: import("immer/dist/internal.js").WritableDraft<ComponentTypeState>, action: {
12
13
  payload: ComponentType[];
13
14
  }) => void;
15
+ setComponentTypeAttachments: (state: ComponentTypeState, action: {
16
+ payload: import('../../typings/models/issues.ts').Created<ComponentTypeAttachment>[];
17
+ type: string;
18
+ }) => void;
19
+ addComponentTypeAttachment: (state: ComponentTypeState, action: {
20
+ payload: import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>;
21
+ type: string;
22
+ }) => void;
23
+ addComponentTypeAttachments: (state: ComponentTypeState, action: {
24
+ payload: import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>[];
25
+ type: string;
26
+ }) => void;
27
+ updateComponentTypeAttachment: (state: ComponentTypeState, action: {
28
+ payload: import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>;
29
+ type: string;
30
+ }) => void;
31
+ removeComponentTypeAttachment: (state: ComponentTypeState, action: {
32
+ payload: string;
33
+ type: string;
34
+ }) => void;
35
+ removeComponentTypeAttachments: (state: ComponentTypeState, action: {
36
+ payload: string[];
37
+ type: string;
38
+ }) => void;
14
39
  toggleComponentTypeVisibility: (state: import("immer/dist/internal.js").WritableDraft<ComponentTypeState>, action: {
15
40
  payload: string;
16
41
  }) => void;
@@ -29,6 +54,13 @@ interface selectNumberOfComponentTypesMatchingCaseInsensitiveNameProps {
29
54
  export declare const selectNumberOfComponentTypesMatchingCaseInsensitiveName: SelectorWithArgs<selectNumberOfComponentTypesMatchingCaseInsensitiveNameProps, number>;
30
55
  export declare const selectComponentTypesByName: SelectorWithArgs<string, ComponentType[]>;
31
56
  export declare const selectHiddenComponentTypeIds: AppSelector<Record<string, boolean | undefined>>;
32
- export declare const addComponentType: import("@reduxjs/toolkit").ActionCreatorWithPayload<ComponentType, "componentTypes/addComponentType">, setComponentTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<ComponentType[], "componentTypes/setComponentTypes">, toggleComponentTypeVisibility: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "componentTypes/toggleComponentTypeVisibility">, deleteComponentType: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "componentTypes/deleteComponentType">;
57
+ export declare const selectComponentTypeAttachmentMapping: (state: RootState) => Record<string, ComponentTypeAttachment>;
58
+ export declare const selectAllComponentTypeAttachments: Selector<Stored<ComponentTypeAttachment>[]>;
59
+ export declare const selectAttachmentsOfComponentType: (args: string) => (state: RootState) => Stored<ComponentTypeAttachment>[];
60
+ export declare const selectAttachmentsOfComponentTypeByType: (args: string) => (state: RootState) => {
61
+ fileAttachments: Stored<ComponentTypeAttachment>[];
62
+ imageAttachments: Stored<ComponentTypeAttachment>[];
63
+ };
64
+ export declare const addComponentType: import("@reduxjs/toolkit").ActionCreatorWithPayload<ComponentType, "componentTypes/addComponentType">, setComponentTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<ComponentType[], "componentTypes/setComponentTypes">, setComponentTypeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<import('../../typings/models/issues.ts').Created<ComponentTypeAttachment>[], "componentTypes/setComponentTypeAttachments">, addComponentTypeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>, "componentTypes/addComponentTypeAttachment">, addComponentTypeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>[], "componentTypes/addComponentTypeAttachments">, updateComponentTypeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>, "componentTypes/updateComponentTypeAttachment">, removeComponentTypeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "componentTypes/removeComponentTypeAttachment">, removeComponentTypeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "componentTypes/removeComponentTypeAttachments">, toggleComponentTypeVisibility: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "componentTypes/toggleComponentTypeVisibility">, deleteComponentType: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "componentTypes/deleteComponentType">;
33
65
  export declare const componentTypeReducer: Reducer<ComponentTypeState>;
34
66
  export {};
@@ -24,21 +24,36 @@ export declare const issueSlice: import("@reduxjs/toolkit").Slice<IssueState, {
24
24
  setIssues: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: {
25
25
  payload: Created<Issue>[];
26
26
  }) => void;
27
- setAttachments: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<Created<IssueAttachment>[]>) => void;
27
+ setIssueAttachments: (state: IssueState, action: {
28
+ payload: Created<IssueAttachment>[];
29
+ type: string;
30
+ }) => void;
28
31
  setActiveIssueId: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: {
29
32
  payload: string | null;
30
33
  }) => void;
31
34
  addIssue: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: {
32
35
  payload: Submitted<Issue>;
33
36
  }) => void;
34
- addAttachment: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<Submitted<IssueAttachment>>) => void;
35
- addAttachments: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<Submitted<IssueAttachment>[]>) => void;
37
+ addIssueAttachment: (state: IssueState, action: {
38
+ payload: Submitted<IssueAttachment>;
39
+ type: string;
40
+ }) => void;
41
+ addIssueAttachments: (state: IssueState, action: {
42
+ payload: Submitted<IssueAttachment>[];
43
+ type: string;
44
+ }) => void;
36
45
  updateIssue: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: {
37
46
  payload: Submitted<Partial<Issue>>;
38
47
  }) => void;
39
- updateAttachment: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<Submitted<IssueAttachment>>) => void;
48
+ updateIssueAttachment: (state: IssueState, action: {
49
+ payload: Submitted<IssueAttachment>;
50
+ type: string;
51
+ }) => void;
40
52
  removeIssue: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<string>) => void;
41
- removeAttachment: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<string>) => void;
53
+ removeIssueAttachment: (state: IssueState, action: {
54
+ payload: string;
55
+ type: string;
56
+ }) => void;
42
57
  removeAttachmentsOfIssue: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<string>) => void;
43
58
  setVisibleStatuses: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<IssueStatus[]>) => void;
44
59
  setVisibleUserIds: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: {
@@ -54,7 +69,7 @@ export declare const issueSlice: import("@reduxjs/toolkit").Slice<IssueState, {
54
69
  resetRecentIssues: (state: import("immer/dist/internal.js").WritableDraft<IssueState>) => void;
55
70
  removeRecentIssue: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<string>) => void;
56
71
  }, "issues">;
57
- export declare const addAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueAttachment>, "issues/addAttachment">, addAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueAttachment>[], "issues/addAttachments">, addIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<Issue>, "issues/addIssue">, addOrReplaceIssueComment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueComment>, "issues/addOrReplaceIssueComment">, addToRecentIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/addToRecentIssues">, cleanRecentIssues: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"issues/cleanRecentIssues">, removeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeAttachment">, removeAttachmentsOfIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeAttachmentsOfIssue">, removeIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeIssue">, removeIssueComment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeIssueComment">, removeRecentIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeRecentIssue">, resetRecentIssues: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"issues/resetRecentIssues">, setActiveIssueId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, "issues/setActiveIssueId">, setAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Created<IssueAttachment>[], "issues/setAttachments">, setIssueComments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Created<IssueComment>[], "issues/setIssueComments">, setIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<Created<Issue>[], "issues/setIssues">, setVisibleStatuses: import("@reduxjs/toolkit").ActionCreatorWithPayload<IssueStatus[], "issues/setVisibleStatuses">, setVisibleUserIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<(number | null)[], "issues/setVisibleUserIds">, updateAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueAttachment>, "issues/updateAttachment">, updateIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<Partial<Issue>>, "issues/updateIssue">;
72
+ export declare const addIssueAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueAttachment>, "issues/addIssueAttachment">, addIssueAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueAttachment>[], "issues/addIssueAttachments">, addIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<Issue>, "issues/addIssue">, addOrReplaceIssueComment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueComment>, "issues/addOrReplaceIssueComment">, addToRecentIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/addToRecentIssues">, cleanRecentIssues: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"issues/cleanRecentIssues">, removeIssueAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeIssueAttachment">, removeAttachmentsOfIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeAttachmentsOfIssue">, removeIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeIssue">, removeIssueComment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeIssueComment">, removeRecentIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeRecentIssue">, resetRecentIssues: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"issues/resetRecentIssues">, setActiveIssueId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, "issues/setActiveIssueId">, setIssueAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Created<IssueAttachment>[], "issues/setIssueAttachments">, setIssueComments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Created<IssueComment>[], "issues/setIssueComments">, setIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<Created<Issue>[], "issues/setIssues">, setVisibleStatuses: import("@reduxjs/toolkit").ActionCreatorWithPayload<IssueStatus[], "issues/setVisibleStatuses">, setVisibleUserIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<(number | null)[], "issues/setVisibleUserIds">, updateIssueAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueAttachment>, "issues/updateIssueAttachment">, updateIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<Partial<Issue>>, "issues/updateIssue">;
58
73
  export interface IssueFilterArgs {
59
74
  filterByAssignedTo: boolean;
60
75
  filterByStatus: boolean;
@@ -72,32 +87,37 @@ export declare const selectIssueAttachments: Selector<Stored<IssueAttachment>[]>
72
87
  export declare const selectPhotoAttachmentsOfIssue: SelectorWithArgs<string, Stored<IssueAttachment>[]>;
73
88
  export declare const selectCommentMapping: (state: RootState) => Record<string, Stored<IssueComment>>;
74
89
  export declare const selectCommentsOfIssue: (args: string) => (state: RootState) => Stored<IssueComment>[];
90
+ export declare const selectAttachmentsOfIssue: (args: string) => (state: RootState) => Stored<IssueAttachment>[];
91
+ export declare const selectAttachmentsOfIssueByType: (args: string) => (state: RootState) => {
92
+ fileAttachments: Stored<IssueAttachment>[];
93
+ imageAttachments: Stored<IssueAttachment>[];
94
+ };
75
95
  export declare const selectFileAttachmentsOfIssue: (args: string) => (state: RootState) => Stored<IssueAttachment>[] | undefined;
76
96
  export declare const selectIssue: SelectorWithArgs<string, Stored<Issue> | undefined>;
77
97
  export declare const selectAllAttachments: ((state: import("redux").EmptyObject & {
78
- versioning: import('../slices/versioningSlice').VersioningState;
79
- fileReducer: import('..').FileState;
80
- authReducer: import('..').AuthState;
98
+ versioning: import('../slices/versioningSlice.ts').VersioningState;
99
+ fileReducer: import("index.ts").FileState;
100
+ authReducer: import("index.ts").AuthState;
81
101
  categoryReducer: import("./categorySlice").CategoryState;
82
- componentReducer: import('..').ComponentState;
83
- componentStageCompletionReducer: import('..').ComponentStageCompletionState;
84
- componentStageReducer: import('..').ComponentStageState;
85
- componentTypeReducer: import('..').ComponentTypeState;
102
+ componentReducer: import("index.ts").ComponentState;
103
+ componentStageCompletionReducer: import("index.ts").ComponentStageCompletionState;
104
+ componentStageReducer: import("index.ts").ComponentStageState;
105
+ componentTypeReducer: import("index.ts").ComponentTypeState;
86
106
  issueReducer: IssueState;
87
- mapReducer: import('..').MapState;
88
- organizationReducer: import('..').OrganizationState;
89
- outboxReducer: import('..').OutboxState;
90
- projectReducer: import('..').ProjectState;
91
- projectAccessReducer: import('..').ProjectAccessState;
92
- organizationAccessReducer: import('..').OrganizationAccessState;
93
- projectFileReducer: import('..').ProjectFileState;
94
- rehydratedReducer: import('..').RehydratedState;
95
- settingReducer: import('..').SettingState;
96
- userFormReducer: import('..').UserFormState;
97
- userReducer: import('..').UserState;
107
+ mapReducer: import("index.ts").MapState;
108
+ organizationReducer: import("index.ts").OrganizationState;
109
+ outboxReducer: import("index.ts").OutboxState;
110
+ projectReducer: import("index.ts").ProjectState;
111
+ projectAccessReducer: import("index.ts").ProjectAccessState;
112
+ organizationAccessReducer: import("index.ts").OrganizationAccessState;
113
+ projectFileReducer: import("index.ts").ProjectFileState;
114
+ rehydratedReducer: import("index.ts").RehydratedState;
115
+ settingReducer: import("index.ts").SettingState;
116
+ userFormReducer: import("index.ts").UserFormState;
117
+ userReducer: import("index.ts").UserState;
98
118
  workspaceReducer: import("./workspaceSlice").WorkspaceState;
99
- emailDomainsReducer: import('..').EmailDomainState;
100
- licenseReducer: import('..').LicenseState;
119
+ emailDomainsReducer: import("index.ts").EmailDomainState;
120
+ licenseReducer: import("index.ts").LicenseState;
101
121
  } & {
102
122
  offline: import("@redux-offline/redux-offline/lib/types").OfflineState;
103
123
  }) => Stored<IssueAttachment>[]) & import("reselect").OutputSelectorFields<(args_0: Record<string, Stored<IssueAttachment>>) => Stored<IssueAttachment>[], {
@@ -0,0 +1,12 @@
1
+ import { PayloadAction } from "@reduxjs/toolkit";
2
+ import { Created, Stored, Submitted } from "../../typings";
3
+ interface AttachmentState<TState> {
4
+ attachments: Record<string, Stored<TState>>;
5
+ }
6
+ export declare function setAttachments<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<Created<TAttachment>[]>): void;
7
+ export declare function addAttachment<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<Submitted<TAttachment>>): void;
8
+ export declare function addAttachments<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<Submitted<TAttachment>[]>): void;
9
+ export declare function updateAttachment<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<Submitted<TAttachment>>): void;
10
+ export declare function removeAttachment<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<string>): void;
11
+ export declare function removeAttachments<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<string[]>): void;
12
+ export {};
@@ -1,17 +1,24 @@
1
1
  import { OfflineModel } from "./base";
2
2
  import { MaybeObjectURL, UploadedFileModel } from "../files";
3
- interface Attachment extends OfflineModel, UploadedFileModel {
4
- issue_id: string;
3
+ export interface Attachment extends OfflineModel, UploadedFileModel {
5
4
  description?: string;
6
- }
7
- export interface IssueAttachment extends Attachment, UploadedFileModel {
8
5
  file_name: string;
9
6
  file_type: string;
10
7
  }
11
- export interface PhotoAttachmentPayload extends Omit<Attachment, "file"> {
12
- file: MaybeObjectURL<File>;
8
+ export interface IssueAttachment extends Attachment, UploadedFileModel {
9
+ issue_id: string;
10
+ }
11
+ export interface ComponentAttachment extends Attachment, UploadedFileModel {
12
+ component_id: string;
13
13
  }
14
+ export interface ComponentTypeAttachment extends Attachment, UploadedFileModel {
15
+ component_type_id: string;
16
+ }
17
+ /** to get an AttachmentPayload for a specific type, pass in the given AttachmentType
18
+ * ex. AttachmentPayload<IssueAttachment> */
19
+ export type AttachmentPayload<TAttachment> = Omit<TAttachment, "file"> & {
20
+ file: MaybeObjectURL<File>;
21
+ };
14
22
  export interface ProfilePic extends UploadedFileModel {
15
23
  file: string;
16
24
  }
17
- export {};