Skip to content

Commit 1d7bfc8

Browse files
committed
MKT/1947: field type updates with build
1 parent c46df6a commit 1d7bfc8

File tree

4 files changed

+15
-20
lines changed

4 files changed

+15
-20
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/field.d.ts

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
import EventEmitter from "wolfy87-eventemitter";
2+
import postRobot from "post-robot";
23
import { IFieldInitData, IFieldModifierLocationInitData } from "./types";
4+
import { GenericObjectType } from "./types/common.types";
5+
import { Schema } from "./types/stack.types";
36
/** Class representing a field from Contentstack UI. Only available for Custom Field extension */
47
declare class Field {
58
/**
69
* @hideconstructor
710
*/
811
uid: string;
912
data_type: string;
10-
schema: {
11-
[key: string]: any;
12-
};
13+
schema: Schema;
1314
_emitter: EventEmitter;
14-
_data: {
15-
[key: string]: any;
16-
};
17-
_resolvedData: {
18-
[key: string]: any;
19-
};
20-
_self: any;
21-
_connection: any;
22-
constructor(fieldDataObject: IFieldInitData | IFieldModifierLocationInitData, connection: any, emitter: EventEmitter);
15+
_data: GenericObjectType;
16+
_resolvedData: GenericObjectType;
17+
_self: boolean;
18+
_connection: typeof postRobot;
19+
constructor(fieldDataObject: IFieldInitData | IFieldModifierLocationInitData, connection: typeof postRobot, emitter: EventEmitter);
2320
/**
2421
* Sets the data for the current field.
2522
* @param {Object|string|number} data Data to be set on the field
@@ -34,19 +31,17 @@ declare class Field {
3431
*/
3532
getData({ resolved }?: {
3633
resolved?: boolean | undefined;
37-
}): {
38-
[key: string]: any;
39-
};
34+
}): GenericObjectType;
4035
/**
4136
* Sets the focus for a field when an extension is being used. This method shows user presence and highlights the extension field that the user is currently accessing in Contentstack UI.
4237
* @return {Object} A promise object which is resolved when Contentstack UI returns an acknowledgement of the focused state.
4338
*/
44-
setFocus(): any;
39+
setFocus(): void;
4540
/**
4641
* This function is called when another extension programmatically changes data of this field using field.setData() function, only available for extension field, only support extensions of data type text, number, boolean or date.
4742
* @param {function} callback The function to be called when an entry is published.
4843
*/
49-
onChange?(callback: (data: any) => any): void;
44+
onChange?(callback: (data: IFieldInitData) => any): void;
5045
}
5146
export default Field;
5247
//# sourceMappingURL=field.d.ts.map

dist/src/field.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)