Skip to content

Commit 8534863

Browse files
committed
Updated MESSAGES interface to a constant declaration and added export for MESSAGES in index.d.ts.
1 parent 773c7be commit 8534863

File tree

2 files changed

+43
-51
lines changed

2 files changed

+43
-51
lines changed

typings/util/index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* MIT Licensed
55
*
66
*/
7+
export { MESSAGES } from './messages';
78
interface IContentStore {
89
collectionName?: string;
910
collection?: {
@@ -31,5 +32,3 @@ export declare const getLocalesFromCollections: (collections: {
3132
name: string;
3233
locale: string;
3334
}[];
34-
export { MESSAGES } from './messages';
35-
export {};

typings/util/messages.d.ts

Lines changed: 42 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,45 @@
33
* Copyright (c) 2019 Contentstack LLC
44
* MIT Licensed
55
*/
6-
7-
/**
8-
* Type definitions for centralized messages
9-
*/
10-
11-
export interface IMessages {
12-
CONNECTION: {
13-
URL: string;
14-
DB_NAME: string;
15-
COLLECTION_NAMES: string;
16-
DB_OPTIONS: string;
17-
SUCCESS: (connectionUri: string) => string;
18-
};
19-
CONNECTOR: {
20-
INSTANCE_CREATED: string;
21-
};
22-
ASSET: {
23-
PUBLISH_INITIATED: (data: any) => string;
24-
PUBLISH_RESULT: (result: any) => string;
25-
UNPUBLISH_INITIATED: (asset: any) => string;
26-
UNPUBLISH_RESULT: (result: any) => string;
27-
DELETE_INITIATED: (asset: any) => string;
28-
DOES_NOT_EXIST: string;
29-
ONLY_PUBLISHED_PRESENT: (asset: any) => string;
30-
EXISTED_IN_MULTIPLE_FORMS: string;
31-
};
32-
ENTRY: {
33-
PUBLISH_INITIATED: (entry: any) => string;
34-
PUBLISH_RESULT: (result: any) => string;
35-
DELETE_INITIATED: (entry: any) => string;
36-
DELETE_RESULT: (result: any) => string;
37-
};
38-
CONTENT_TYPE: {
39-
UPDATE_RESULT: (result: any) => string;
40-
DELETE_INITIATED: (contentType: any) => string;
41-
DELETE_RESULT: (result: any) => string;
42-
DELETE_ENTRIES_RESULT: (result: any) => string;
43-
};
44-
PROCESS: {
45-
SHUTDOWN: (signal: string, killDuration: number) => string;
46-
UNHANDLED_ERROR: string;
47-
};
48-
LOGGER: {
49-
MESSAGE_MISSING: string;
50-
};
51-
}
52-
53-
export declare const MESSAGES: IMessages;
54-
6+
export declare const MESSAGES: {
7+
CONNECTION: {
8+
URL: string;
9+
DB_NAME: string;
10+
COLLECTION_NAMES: string;
11+
DB_OPTIONS: string;
12+
SUCCESS: (connectionUri: string) => string;
13+
};
14+
CONNECTOR: {
15+
INSTANCE_CREATED: string;
16+
};
17+
ASSET: {
18+
PUBLISH_INITIATED: (data: any) => string;
19+
PUBLISH_RESULT: (result: any) => string;
20+
UNPUBLISH_INITIATED: (asset: any) => string;
21+
UNPUBLISH_RESULT: (result: any) => string;
22+
DELETE_INITIATED: (asset: any) => string;
23+
DOES_NOT_EXIST: string;
24+
ONLY_PUBLISHED_PRESENT: (asset: any) => string;
25+
EXISTED_IN_MULTIPLE_FORMS: string;
26+
};
27+
ENTRY: {
28+
PUBLISH_INITIATED: (entry: any) => string;
29+
PUBLISH_RESULT: (result: any) => string;
30+
DELETE_INITIATED: (entry: any) => string;
31+
DELETE_RESULT: (result: any) => string;
32+
};
33+
CONTENT_TYPE: {
34+
UPDATE_RESULT: (result: any) => string;
35+
DELETE_INITIATED: (contentType: any) => string;
36+
DELETE_RESULT: (result: any) => string;
37+
DELETE_ENTRIES_RESULT: (result: any) => string;
38+
};
39+
PROCESS: {
40+
SHUTDOWN: (signal: string, killDuration: number) => string;
41+
UNHANDLED_ERROR: string;
42+
};
43+
LOGGER: {
44+
MESSAGE_MISSING: string;
45+
};
46+
};
47+
export default MESSAGES;

0 commit comments

Comments
 (0)