diff --git a/lib/annotations/AnnotationModels.js b/lib/annotations/AnnotationModels.js index 520d1cd1..415a4579 100644 --- a/lib/annotations/AnnotationModels.js +++ b/lib/annotations/AnnotationModels.js @@ -318,8 +318,6 @@ var BaseAnnotation = /** @class */ (function () { var _a, _b, _c, _d, _e, _f, _g, _h, _j; /** Opacity value between 0 and 1 */ this.opacity = 1; - /** PDF object identifier */ - this.pdfObjectId = null; /** Version number */ this.v = 1; /** Blend mode */ diff --git a/lib/configuration/AIAssistantConfiguration.js b/lib/configuration/AIAssistantConfiguration.js index 883d72b4..c8ad2e54 100644 --- a/lib/configuration/AIAssistantConfiguration.js +++ b/lib/configuration/AIAssistantConfiguration.js @@ -1,20 +1,2 @@ "use strict"; -/** - * @typedef AIAssistantConfiguration - * @memberof AIAssistantConfiguration - * @property { string } jwt The JSON Web Token used for authentication with your instance of the Nutrient AI Assistant server. - * @property { string } serverUrl Base HTTP URL where your instance of the Nutrient AI Assistant server can be reached. - * @property { string } sessionID A unique identifier for the chat session, which can be used to recall a session in the future. - * @property { string } [userID] An optional user identifier to associate with the session. This will be used to tag session history for user management. - */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.AIAssistantConfiguration = void 0; -/** - * @class AIAssistantConfiguration - */ -var AIAssistantConfiguration = /** @class */ (function () { - function AIAssistantConfiguration() { - } - return AIAssistantConfiguration; -}()); -exports.AIAssistantConfiguration = AIAssistantConfiguration; diff --git a/lib/document/Bookmark.js b/lib/document/Bookmark.js index d9854033..c8ad2e54 100644 --- a/lib/document/Bookmark.js +++ b/lib/document/Bookmark.js @@ -1,18 +1,2 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.Bookmark = void 0; -/** - * A Bookmark is a named location in a document. - * @interface Bookmark - * @memberof Bookmark - * @property {string} [name] - The bookmark name. This is optional. - * @property {string} displayName - The bookmark display name. - * @property {string} identifier - A string uniquely identifying the bookmark. - * @property {number} pageIndex - The page index on which the bookmark is located. - */ -var Bookmark = /** @class */ (function () { - function Bookmark() { - } - return Bookmark; -}()); -exports.Bookmark = Bookmark; diff --git a/lib/document/PDFPageInfo.js b/lib/document/PDFPageInfo.js index 9e6287fc..f40d5d35 100644 --- a/lib/document/PDFPageInfo.js +++ b/lib/document/PDFPageInfo.js @@ -1,15 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PDFPageInfo = void 0; -/** - * @interface PDFPageInfo - */ -var PDFPageInfo = /** @class */ (function () { - function PDFPageInfo() { - } - return PDFPageInfo; -}()); -exports.PDFPageInfo = PDFPageInfo; +var PDFPageInfo; (function (PDFPageInfo) { /** * The rotation of the page. diff --git a/lib/forms/FormElement.js b/lib/forms/FormElement.js index 8bb7b05c..9ac130d5 100644 --- a/lib/forms/FormElement.js +++ b/lib/forms/FormElement.js @@ -70,21 +70,22 @@ exports.TextFieldFormElement = exports.SignatureFormElement = exports.ChoiceForm var FormElement = /** @class */ (function () { function FormElement(data) { if (data === void 0) { data = {}; } + var _a, _b, _c, _d, _e; this.formField = data.formField; this.resettable = data.resettable; this.defaultValue = data.defaultValue; this.exportValue = data.exportValue; this.highlightColor = data.highlightColor; this.calculationOrderIndex = data.calculationOrderIndex; - this.readOnly = data.readOnly; - this.required = data.required; - this.noExport = data.noExport; + this.readOnly = (_a = data.readOnly) !== null && _a !== void 0 ? _a : false; + this.required = (_b = data.required) !== null && _b !== void 0 ? _b : false; + this.noExport = (_c = data.noExport) !== null && _c !== void 0 ? _c : false; this.fieldName = data.fieldName; this.fullyQualifiedFieldName = data.fullyQualifiedFieldName; this.formTypeName = data.formTypeName; this.maxLength = data.maxLength; - this.doNotScroll = data.doNotScroll; - this.isMultiline = data.isMultiline; + this.doNotScroll = (_d = data.doNotScroll) !== null && _d !== void 0 ? _d : false; + this.isMultiline = (_e = data.isMultiline) !== null && _e !== void 0 ? _e : false; } return FormElement; }()); diff --git a/lib/measurements/Measurements.js b/lib/measurements/Measurements.js index 36f9f95c..ac583e0e 100644 --- a/lib/measurements/Measurements.js +++ b/lib/measurements/Measurements.js @@ -1,34 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Measurements = void 0; -/** - * Measurement value configurations define how measurements are displayed and interpreted. - * @typedef MeasurementValueConfiguration - * @memberof Measurements - * @property {Measurements.MeasurementScale} scale - A ratio of a distance on a document page to a corresponding real world distance. - * @property {Measurements.Precision} precision - The smallest value to which measurements will be rounded. - * @property {string} [name] - Names are displayed in user interface and serve to help distinguish different scales. - * @property {boolean} [addToUndo] - Whether this new measurement configuration should be added to the undo stack (Android only). - * @property {boolean} [isSelected] - Whether this new measurement configuration should be set as selected on the UI. - */ -/** - * A ratio of a distance on a document page to a corresponding real world distance. - * @typedef MeasurementScale - * @memberof Measurements - * @property {Measurements.ScaleUnitFrom} unitFrom - The unit for the distance on a document page. - * @property {number} valueFrom - A distance on a document page. The unit of this value is given by ```unitFrom```. - * @property {Measurements.ScaleUnitTo} unitTo - The unit for the real world distance. - * @property {number} valueTo - A real world distance. The unit of this value is given by ```unitTo```. - */ -/** - * @interface Measurements - */ -var Measurements = /** @class */ (function () { - function Measurements() { - } - return Measurements; -}()); -exports.Measurements = Measurements; +var Measurements; (function (Measurements) { /** * The MeasurementScale UnitFrom options. diff --git a/lib/toolbar/Toolbar.js b/lib/toolbar/Toolbar.js index 5796a7c0..e2776453 100644 --- a/lib/toolbar/Toolbar.js +++ b/lib/toolbar/Toolbar.js @@ -1,36 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Toolbar = void 0; -/** - * A toolbar item used to display a custom button on the toolbar. - * @typedef ToolbarItem - * @memberof Toolbar - * @property {string} id - The unique identifier for the custom toolbar button. This will be used to identify the button in the ```onCustomToolbarButtonTapped``` callback. On Android the ID needs to be specified as a resource item inside your application's ```ids.xml``` file. - * @property {string} image - The image name (iOS) or resource ID (Android) for the toolbar button. Images must be included in the application bundle on iOS and specified as a drawable resource on Android. - * @property {string} [title] - The title of the toolbar button (Android only). - * @property {boolean} [showAsAction] - Whether the toolbar button should be displayed on the main toolbar, and not in the drop down menu (Android only). - * @property {boolean} [applyTemplate] - Whether the icon should be rendered using the system's tint color to match the color scheme of other toolbar buttons. Set this to false if your icon already contains color information that should be preserved. - */ -/** - * The toolbar buttons that should be displayed on the toolbar. - * @typedef ToolbarItems - * @memberof Toolbar - * @property {Array} buttons - An array of buttons that should be displayed on the toolbar. The buttons can be either stock toolbar buttons, custom toolbar buttons, or a combination of both. - * @property {string} [viewMode] - The viewMode for which the toolbar buttons should be set (iOS only). - * @property {string} [animated] - Whether the toolbar button change should be animated when they are set (iOS only). - */ -/** - * @interface Toolbar - * @property { Toolbar.ToolbarItems } [leftBarButtonItems] The bar buttons to display on the left side of the navigation bar (iOS only). - * @property { Toolbar.ToolbarItems } [rightBarButtonItems] The bar buttons to display on the right side of the navigation bar (iOS only). - * @property { Toolbar.ToolbarItems } [toolbarMenuItems] The toolbar buttons to display on the toolbar (Android only). - */ -var Toolbar = /** @class */ (function () { - function Toolbar() { - } - return Toolbar; -}()); -exports.Toolbar = Toolbar; +var Toolbar; (function (Toolbar) { /** * The stock toolbar buttons available to display on the Nutrient toolbar. diff --git a/src/annotations/AnnotationModels.ts b/src/annotations/AnnotationModels.ts index e50fb0dc..01b45f1b 100644 --- a/src/annotations/AnnotationModels.ts +++ b/src/annotations/AnnotationModels.ts @@ -326,9 +326,9 @@ export class BaseAnnotation { /** Opacity value between 0 and 1 */ opacity: number = 1; /** PDF object identifier */ - pdfObjectId?: number = null; + pdfObjectId?: number; /** Annotation type */ - type: string; + type?: string; /** Annotation flags */ flags?: Array; /** Version number */ @@ -919,7 +919,7 @@ export class NoteAnnotation extends BaseAnnotation { flags?: Array; customData?: Object; color?: string; - icon?: 'comment' | 'rightPointer' | 'rightArrow' | 'check' | 'circle' | 'cross' | + icon?: 'comment' | 'rightPointer' | 'rightArrow' | 'check' | 'circle' | 'cross' | 'insert' | 'newParagraph' | 'note' | 'paragraph' | 'help' | 'star' | 'key'; text?: string | { format: string; value: string; }; }) { @@ -1580,4 +1580,4 @@ export type AnnotationType = | StrikeOutMarkupAnnotation | TextAnnotation | UnderlineMarkupAnnotation - | WidgetAnnotation; \ No newline at end of file + | WidgetAnnotation; diff --git a/src/configuration/AIAssistantConfiguration.ts b/src/configuration/AIAssistantConfiguration.ts index 5c0201a3..de1a30f2 100644 --- a/src/configuration/AIAssistantConfiguration.ts +++ b/src/configuration/AIAssistantConfiguration.ts @@ -2,15 +2,11 @@ * @typedef AIAssistantConfiguration * @memberof AIAssistantConfiguration * @property { string } jwt The JSON Web Token used for authentication with your instance of the Nutrient AI Assistant server. - * @property { string } serverUrl Base HTTP URL where your instance of the Nutrient AI Assistant server can be reached. + * @property { string } serverURL Base HTTP URL where your instance of the Nutrient AI Assistant server can be reached. * @property { string } sessionID A unique identifier for the chat session, which can be used to recall a session in the future. * @property { string } [userID] An optional user identifier to associate with the session. This will be used to tag session history for user management. */ - -/** - * @class AIAssistantConfiguration - */ -export class AIAssistantConfiguration { +export interface AIAssistantConfiguration { /** * The JSON Web Token used for authentication with your instance of the Nutrient AI Assistant server. */ @@ -27,4 +23,4 @@ export class AIAssistantConfiguration { * An optional user identifier to associate with the session. This will be used to tag session history for user management. */ userID?: string; -} \ No newline at end of file +} diff --git a/src/document/Bookmark.ts b/src/document/Bookmark.ts index 6f3fcfd7..131ecaf3 100644 --- a/src/document/Bookmark.ts +++ b/src/document/Bookmark.ts @@ -7,7 +7,7 @@ * @property {string} identifier - A string uniquely identifying the bookmark. * @property {number} pageIndex - The page index on which the bookmark is located. */ -export class Bookmark { +export interface Bookmark { /** * The bookmark name. This is optional. */ @@ -24,4 +24,4 @@ export class Bookmark { * The page index on which the bookmark is located. */ pageIndex: number; -} \ No newline at end of file +} diff --git a/src/document/PDFPageInfo.ts b/src/document/PDFPageInfo.ts index dd0e9100..d21c328f 100644 --- a/src/document/PDFPageInfo.ts +++ b/src/document/PDFPageInfo.ts @@ -1,7 +1,7 @@ /** * @interface PDFPageInfo */ -export class PDFPageInfo { +export interface PDFPageInfo { /** * The angle the PDF page is displayed at in clockwise degrees. */ @@ -35,4 +35,4 @@ export namespace PDFPageInfo { export type PDFRotation = ValueOf; type ValueOf = T[keyof T]; -} \ No newline at end of file +} diff --git a/src/forms/FormElement.ts b/src/forms/FormElement.ts index b9f23ced..14168154 100644 --- a/src/forms/FormElement.ts +++ b/src/forms/FormElement.ts @@ -85,7 +85,7 @@ export class FormElement { /** * The calculation order index. */ - calculationOrderIndex: number; + calculationOrderIndex?: number; /** * Whether the form element is read-only. @@ -115,12 +115,12 @@ export class FormElement { /** * The type name of the form. */ - formTypeName: string; + formTypeName?: string; /** * The maximum length of the form element. */ - maxLength: number; + maxLength?: number; /** * Whether scrolling is disabled. @@ -139,15 +139,15 @@ export class FormElement { this.exportValue = data.exportValue; this.highlightColor = data.highlightColor; this.calculationOrderIndex = data.calculationOrderIndex; - this.readOnly = data.readOnly; - this.required = data.required; - this.noExport = data.noExport; + this.readOnly = data.readOnly ?? false; + this.required = data.required ?? false; + this.noExport = data.noExport ?? false; this.fieldName = data.fieldName; this.fullyQualifiedFieldName = data.fullyQualifiedFieldName; this.formTypeName = data.formTypeName; this.maxLength = data.maxLength; - this.doNotScroll = data.doNotScroll; - this.isMultiline = data.isMultiline; + this.doNotScroll = data.doNotScroll ?? false; + this.isMultiline = data.isMultiline ?? false; } } @@ -262,4 +262,4 @@ export class TextFieldFormElement extends FormElement { this.fontSize = data.fontSize || 12; this.fontName = data.fontName; } -} \ No newline at end of file +} diff --git a/src/measurements/Measurements.ts b/src/measurements/Measurements.ts index 9e6bd20d..4a8965be 100644 --- a/src/measurements/Measurements.ts +++ b/src/measurements/Measurements.ts @@ -17,11 +17,6 @@ * @property {Measurements.ScaleUnitTo} unitTo - The unit for the real world distance. * @property {number} valueTo - A real world distance. The unit of this value is given by ```unitTo```. */ -/** - * @interface Measurements - */ -export class Measurements {} - export interface MeasurementValueConfiguration { /** * Names are displayed in user interface and serve to help distinguish different scales. @@ -177,4 +172,4 @@ export namespace Measurements { export type ScaleUnitTo = ValueOf; export type Precision = ValueOf; type ValueOf = T[keyof T]; -} \ No newline at end of file +} diff --git a/src/toolbar/Toolbar.ts b/src/toolbar/Toolbar.ts index 4744616e..b743670b 100644 --- a/src/toolbar/Toolbar.ts +++ b/src/toolbar/Toolbar.ts @@ -6,7 +6,7 @@ * @property {string} image - The image name (iOS) or resource ID (Android) for the toolbar button. Images must be included in the application bundle on iOS and specified as a drawable resource on Android. * @property {string} [title] - The title of the toolbar button (Android only). * @property {boolean} [showAsAction] - Whether the toolbar button should be displayed on the main toolbar, and not in the drop down menu (Android only). - * @property {boolean} [applyTemplate] - Whether the icon should be rendered using the system's tint color to match the color scheme of other toolbar buttons. Set this to false if your icon already contains color information that should be preserved. + * @property {boolean} [applyTemplate] - Whether the icon should be rendered using the system's tint color to match the color scheme of other toolbar buttons. Set this to false if your icon already contains color information that should be preserved. */ /** * The toolbar buttons that should be displayed on the toolbar. @@ -22,7 +22,7 @@ * @property { Toolbar.ToolbarItems } [rightBarButtonItems] The bar buttons to display on the right side of the navigation bar (iOS only). * @property { Toolbar.ToolbarItems } [toolbarMenuItems] The toolbar buttons to display on the toolbar (Android only). */ -export class Toolbar { +export interface Toolbar { /** * The bar buttons to display on the left side of the navigation bar (iOS only). */ @@ -55,7 +55,7 @@ export interface ToolbarItem { */ showAsAction?: boolean; /** - * Whether the icon should be rendered using the system's tint color to match the color scheme of other toolbar buttons. Set this to false if your icon already contains color information that should be preserved. + * Whether the icon should be rendered using the system's tint color to match the color scheme of other toolbar buttons. Set this to false if your icon already contains color information that should be preserved. */ applyTemplate?: boolean; } @@ -125,4 +125,4 @@ export namespace Toolbar { export type DefaultToolbarButton = ValueOf; export type PDFViewMode = ValueOf; type ValueOf = T[keyof T]; -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index 7e50b8d7..8470b144 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,8 +3,9 @@ "./src/**/*", ], "compilerOptions": { + "strict": true, "rootDir": "src", "skipLibCheck": true, "outDir": "./lib", } -} \ No newline at end of file +}