/* eslint-disable */ /* tslint:disable */ /** * This is an autogenerated file created by the Stencil compiler. * It contains typing information for all components that exist in this project. */ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime"; import { ApiEndpoints, BundleEndpoints, Env, HostEnv } from "./types"; import { ItemConfig, PieContent, PieModel } from "@pie-framework/pie-player-components/dist/types/interface"; import { PreReleaseType } from "./interface"; export { ApiEndpoints, BundleEndpoints, Env, HostEnv } from "./types"; export { ItemConfig, PieContent, PieModel } from "@pie-framework/pie-player-components/dist/types/interface"; export { PreReleaseType } from "./interface"; export namespace Components { interface EnterToken { "value": string; } interface ErrorMessage { "message": string; } interface PieApiAuthor { /** * Adds a preview view which will render the content in another tab as it may appear to a student or instructor. */ "addPreview": boolean; /** * Utility method to add a `@pie-element/rubric` section to an item config when creating an item should be used before setting the config. * @deprecated this method is for temporary use, will be removed at next major release * @param config the item config to mutate * @param rubricModel optional model to pass to `@pie-element/rubric` */ "addRubricToConfig": (config: ItemConfig, rubricModel?: any) => Promise; /** * Provide custom endpoints for the player components. Can be proxy or direct. */ "bundleEndpoints"?: BundleEndpoints; /** * Optional. The unique identifier for the Collection in which the content item will be stored in the PIE Service CMS. */ "collectionId"?: string; /** * To customize the standard behaviour provided by interaction configuration views you can provide settings key-ed by the package name. e.g. `{ '@pie-element/inline-choice': { promptLabel: 'Item Stem' } }` The settings that are configurable for each authoring view are documented in the `@package-name/docs` folder for each package. */ "configSettings"?: { [packageName: string]: Object }; /** * The model for the content. If set, the view will update to render the provided config. */ "contentConfig": PieContent; /** * The unique versioned identifier `id@semver-version` for the Pie Content Item stored in the PIE Service CMS. */ "contentId"?: string; /** * Creates a new content item from the currently loaded contents. * @param preReleaseType - see preRelaseType for the `save` method */ "create": (preReleaseType?: string) => Promise; /** * Optional. Set a default model for complex-rubric item (works with pie-player-components versions above v1.2.0). */ "defaultComplexRubricModel"?: Object; /** * Enable exception tracking. */ "exceptions": boolean; /** * TODO Gets a list of all versions that exist for this Content Item. */ "getVersions": () => Promise; /** * Choose 'dev' , 'stage' or 'prod' environments for back end. */ "host"?: HostEnv; /** * Loads a content item from `pie-api` host into the view. * @param contentId the unique versioned identifer `id@version` for the content item to load. If this param is not provided and `content-id` attribute has a value, that value will be used to load the content item. */ "load": (contentId?: any) => Promise; /** * If true, the `@version` tag for elements in the configuration will be ignored and a static version for that interaction type determined by the current release of this pie-api-author component will be used. */ "lockVersions"?: boolean; /** * Override element versions. Requires the 'overrides' scope in the token in pie-api matches the key against the element names and if matching uses the overridden version if a string it's parsed as a json string */ "overrides": string | { [key: string]: string }; /** * used to automatically re-fetch the bundle (in case we get a 503); defaults to false */ "reFetchBundle"?: boolean; /** * Enable screen recording with logrocket. Note: not to be used in production unless for temporary use to track down a specific user problem. */ "recordScreen": boolean; /** * If screen recording enabled for debug purposes, use this property to provide a unique identifer for the user whose session is being recorded. */ "recordScreenIdentity": string; /** * Release a pre-release version of the content currently loaded in the authoring view. Throws an exception if the version of the current Content Item does not have a pre-release tag e.g.`1.0.1-draft` example: (`contentId = 'abc@1.0.1-draft`) `this.release() => 'abc@1.0.1`' */ "release": () => Promise; /** * Saves an update to an existing pre-released content item. The content item version must be in pre-release state. the `preReleaseType` param determines what kind of version update, if any, will be performed. `null` - (default) writes over existing pre-release content, , e.g.`1.0.0-draft.0 -> 1.0.0-draft.0`\n `prerelease` - writes in increment to the prerelease version, e.g. `1.0.0-draft.0 -> 1.0.0-draft.1`\n `premajor` - creates a new major release from version, e.g. `1.0.0-draft.1 -> 2.0.0-draft.0`\n `preminor` - creates a new minor release from version, e.g. `1.0.0-draft.1 -> 1.1.0-draft.0`\n `prepatch` - creates a new patch release from version, e.g. `1.0.0-draft.1 -> 1.0.1-draft.0`\m * @param preReleaseType - the type of update to perform */ "save": (preReleaseType?: PreReleaseType) => Promise; /** * The api token for `pie-api` access. */ "token": string; /** * this method is for having the possibility to access validateModels from player

It returns the model of the item and errors field which contains the errors returned by validate function in controller. It is an asynchronous method, so it needs to be called with await */ "validate": () => Promise; "version": () => Promise; } interface PieApiPlayer { /** * It will allow to resize passage and item width for items with stimulus */ "allowedResize"?: boolean; /** * The identifier for the related assignment. This is only used when loading by itemId. */ "assignmentId": string; /** * Provide custom endpoints for the player components. Can be proxy or direct. */ "bundleEndpoints"?: BundleEndpoints; "customClassname"?: string; /** * Customize any of the api endpoint fields. */ "customConfig": ApiEndpoints; /** * Customize markup. */ "customMarkup"?: string; /** * Customize model. */ "customModels"?: any[]; /** * Customize passage models. */ "customPassageModels"?: any[]; /** * The current environment context in which to render the player. See notes. */ "env"?: Env; /** * Enable exception tracking with New Relic. */ "exceptions": boolean; /** * Support styling with external stylesheet urls (comma separated urls) Target the pie-player component using the class provided in the class property Parse the css file and add the class to the stylesheet to scope the styles The last stylesheet url takes priority if the selectors have the same specificity. */ "externalStyleUrls": string; /** * Choose 'dev' , 'stage' or 'prod' environments for back end. */ "host"?: HostEnv; /** * The mode to be used when player is initialized */ "initialMode": string; /** * Initial delay in milliseconds before the first retry attempt. This value is used as the base for exponential backoff calculation. Default: 500 (0.5 seconds) */ "initialRetryDelayMs"?: number; /** * The role to be used when player is initialized */ "initialRole": string; /** * The identifier for the content to load. The player will immediately load the content when this property is set. */ "itemId": string; /** * Maximum number of retry attempts for failed requests. Does not include the initial request attempt. Default: 2 */ "maxRetryAttempts"?: number; /** * Maximum delay in milliseconds between retry attempts. Caps the exponential backoff to prevent excessively long waits. Default: 2000 (2 seconds) */ "maxRetryDelayMs"?: number; /** * Use the beta controllers for pie-elements */ "optimize": boolean; /** * Override element versions. Requires the 'overrides' scope in the token in pie-api matches the key against the element names and if matching uses the overridden version if a string it's parsed as a json string */ "overrides": string | { [key: string]: string }; /** * If this property is set the item will be rendered in a `preview` state by the player. This means no server-side calls will be made and no reponse-session will be created/stored in pie-api. */ "preview": boolean; /** * used to automatically re-fetch the bundle (in case we get a 503); defaults to false */ "reFetchBundle"?: boolean; /** * Enable screen recording with New Relic. Note: not to be used in production unless for temporary use to track down a specific user problem. Defaults to false */ "recordScreen": boolean; /** * If screen recording enabled for debug purposes, use this property to provide a unique identifer for the user whose session is being recorded. */ "recordScreenIdentity": string; /** * If the item contains a passage, the player will render it by default. Set this property to false to not render passage. */ "renderStimulus": boolean; /** * Maximum time in milliseconds to wait for a response before aborting the request. Used to prevent requests from hanging indefinitely in poor network conditions. Default: 10000 (10 seconds) */ "requestTimeoutMs"?: number; "saveSession": () => Promise; /** * Return the evaluated score for the current response. The api token must provide permission to authorize the use of this method. Note: Score does not (yet) work when in preview mode - will resolve to null if `preview` is `true` * @param disablePartialScoring - if true all interactions will be scored as either correct or incorrect */ "score": (disablePartialScoring?: boolean) => Promise; /** * If provided, will load the assessment session identified by the id. An assessment session is the record of a student's interaction with the item. The player will immediately load the assessment session when this property is set. */ "sessionId"?: string; /** * In evaluate mode, add a bottom border to visually separate each item in the case of a multi-item */ "showBottomBorder": boolean; /** * A JWT token to authorize requests on behalf of the player. This token for accessing pie-api can be generated with a valid Api Client Id and Secret. */ "token": string; /** * Enable tracking page actions/events with New Relic. Note: Setting this to true increases data sent to New Relic, which may affect costs. */ "trackPageActions": boolean; } interface TokenHelper { } } export interface EnterTokenCustomEvent extends CustomEvent { detail: T; target: HTMLEnterTokenElement; } export interface PieApiAuthorCustomEvent extends CustomEvent { detail: T; target: HTMLPieApiAuthorElement; } export interface PieApiPlayerCustomEvent extends CustomEvent { detail: T; target: HTMLPieApiPlayerElement; } declare global { interface HTMLEnterTokenElement extends Components.EnterToken, HTMLStencilElement { } var HTMLEnterTokenElement: { prototype: HTMLEnterTokenElement; new (): HTMLEnterTokenElement; }; interface HTMLErrorMessageElement extends Components.ErrorMessage, HTMLStencilElement { } var HTMLErrorMessageElement: { prototype: HTMLErrorMessageElement; new (): HTMLErrorMessageElement; }; interface HTMLPieApiAuthorElement extends Components.PieApiAuthor, HTMLStencilElement { } var HTMLPieApiAuthorElement: { prototype: HTMLPieApiAuthorElement; new (): HTMLPieApiAuthorElement; }; interface HTMLPieApiPlayerElement extends Components.PieApiPlayer, HTMLStencilElement { } var HTMLPieApiPlayerElement: { prototype: HTMLPieApiPlayerElement; new (): HTMLPieApiPlayerElement; }; interface HTMLTokenHelperElement extends Components.TokenHelper, HTMLStencilElement { } var HTMLTokenHelperElement: { prototype: HTMLTokenHelperElement; new (): HTMLTokenHelperElement; }; interface HTMLElementTagNameMap { "enter-token": HTMLEnterTokenElement; "error-message": HTMLErrorMessageElement; "pie-api-author": HTMLPieApiAuthorElement; "pie-api-player": HTMLPieApiPlayerElement; "token-helper": HTMLTokenHelperElement; } } declare namespace LocalJSX { interface EnterToken { "onToken"?: (event: EnterTokenCustomEvent) => void; "value"?: string; } interface ErrorMessage { "message"?: string; } interface PieApiAuthor { /** * Adds a preview view which will render the content in another tab as it may appear to a student or instructor. */ "addPreview"?: boolean; /** * Provide custom endpoints for the player components. Can be proxy or direct. */ "bundleEndpoints"?: BundleEndpoints; /** * Optional. The unique identifier for the Collection in which the content item will be stored in the PIE Service CMS. */ "collectionId"?: string; /** * To customize the standard behaviour provided by interaction configuration views you can provide settings key-ed by the package name. e.g. `{ '@pie-element/inline-choice': { promptLabel: 'Item Stem' } }` The settings that are configurable for each authoring view are documented in the `@package-name/docs` folder for each package. */ "configSettings"?: { [packageName: string]: Object }; /** * The model for the content. If set, the view will update to render the provided config. */ "contentConfig"?: PieContent; /** * The unique versioned identifier `id@semver-version` for the Pie Content Item stored in the PIE Service CMS. */ "contentId"?: string; /** * Optional. Set a default model for complex-rubric item (works with pie-player-components versions above v1.2.0). */ "defaultComplexRubricModel"?: Object; /** * Enable exception tracking. */ "exceptions"?: boolean; /** * Choose 'dev' , 'stage' or 'prod' environments for back end. */ "host"?: HostEnv; /** * If true, the `@version` tag for elements in the configuration will be ignored and a static version for that interaction type determined by the current release of this pie-api-author component will be used. */ "lockVersions"?: boolean; /** * When the `contentId` property is set, it will be parsed to ensure it is a valid identifier and to determine if the version is released or pre-release. the `event.detail` value will be `{valid: true | false, status: 'released' | 'pre-release'}` */ "onContentIdValidated"?: (event: PieApiAuthorCustomEvent) => void; /** * Content has been loaded from server */ "onContentLoaded"?: (event: PieApiAuthorCustomEvent) => void; /** * If `recordScreen` property is set to true this event will be emitted with the url for recorded screen session in `detail` property. */ "onRecordingStarted"?: (event: PieApiAuthorCustomEvent) => void; /** * Override element versions. Requires the 'overrides' scope in the token in pie-api matches the key against the element names and if matching uses the overridden version if a string it's parsed as a json string */ "overrides"?: string | { [key: string]: string }; /** * used to automatically re-fetch the bundle (in case we get a 503); defaults to false */ "reFetchBundle"?: boolean; /** * Enable screen recording with logrocket. Note: not to be used in production unless for temporary use to track down a specific user problem. */ "recordScreen"?: boolean; /** * If screen recording enabled for debug purposes, use this property to provide a unique identifer for the user whose session is being recorded. */ "recordScreenIdentity"?: string; /** * The api token for `pie-api` access. */ "token"?: string; } interface PieApiPlayer { /** * It will allow to resize passage and item width for items with stimulus */ "allowedResize"?: boolean; /** * The identifier for the related assignment. This is only used when loading by itemId. */ "assignmentId"?: string; /** * Provide custom endpoints for the player components. Can be proxy or direct. */ "bundleEndpoints"?: BundleEndpoints; "customClassname"?: string; /** * Customize any of the api endpoint fields. */ "customConfig"?: ApiEndpoints; /** * Customize markup. */ "customMarkup"?: string; /** * Customize model. */ "customModels"?: any[]; /** * Customize passage models. */ "customPassageModels"?: any[]; /** * The current environment context in which to render the player. See notes. */ "env"?: Env; /** * Enable exception tracking with New Relic. */ "exceptions"?: boolean; /** * Support styling with external stylesheet urls (comma separated urls) Target the pie-player component using the class provided in the class property Parse the css file and add the class to the stylesheet to scope the styles The last stylesheet url takes priority if the selectors have the same specificity. */ "externalStyleUrls"?: string; /** * Choose 'dev' , 'stage' or 'prod' environments for back end. */ "host"?: HostEnv; /** * The mode to be used when player is initialized */ "initialMode"?: string; /** * Initial delay in milliseconds before the first retry attempt. This value is used as the base for exponential backoff calculation. Default: 500 (0.5 seconds) */ "initialRetryDelayMs"?: number; /** * The role to be used when player is initialized */ "initialRole"?: string; /** * The identifier for the content to load. The player will immediately load the content when this property is set. */ "itemId"?: string; /** * Maximum number of retry attempts for failed requests. Does not include the initial request attempt. Default: 2 */ "maxRetryAttempts"?: number; /** * Maximum delay in milliseconds between retry attempts. Caps the exponential backoff to prevent excessively long waits. Default: 2000 (2 seconds) */ "maxRetryDelayMs"?: number; /** * Emitted when the `pie-api-player` encounters an error in the following cases: - Loading the item or session. - Updating the item, session, or token. - Environment configuration issues. - Saving session data fails. Event detail contains: - `message`: A high-level description of the error. - `details`: Detailed error information or stack trace. Example usage: ```javascript player.addEventListener("api-player-error", (event) => { console.error("Error from API Player:", event.detail); }); ``` */ "onApi-player-error"?: (event: PieApiPlayerCustomEvent) => void; /** * Emitted when the model was reloaded, content item query was called with the new content version. */ "onModel-reload"?: (event: PieApiPlayerCustomEvent) => void; /** * If `recordUserSession` property is set to true, detailed user session data will be sent to New Relic for troubleshooting purposes. */ "onRecordingStarted"?: (event: PieApiPlayerCustomEvent) => void; /** * The player will auto-save response session data when the response is changed by the user. If it encounters an error saving this response to the item session, this event will be emitted. The event detail will contain the exception thrown by the attempted save. */ "onSaveSessionError"?: (event: PieApiPlayerCustomEvent) => void; /** * Emitted when an item has loaded with a sessionId that was not specified on load. The event detail contains the generated session id and data. `event.detail === {id: session_id, data:[session_data]}` */ "onSession-created"?: (event: PieApiPlayerCustomEvent) => void; /** * pie-api-player listens for `session-changed`events from pie-player and auto-saves the response to pie-api. This event will be emitted when that request completes successfully. If not a `saveSessionError`event will be emitted. The event detail will contain the session id of the session that was saved. */ "onSessionSaved"?: (event: PieApiPlayerCustomEvent) => void; /** * Use the beta controllers for pie-elements */ "optimize"?: boolean; /** * Override element versions. Requires the 'overrides' scope in the token in pie-api matches the key against the element names and if matching uses the overridden version if a string it's parsed as a json string */ "overrides"?: string | { [key: string]: string }; /** * If this property is set the item will be rendered in a `preview` state by the player. This means no server-side calls will be made and no reponse-session will be created/stored in pie-api. */ "preview"?: boolean; /** * used to automatically re-fetch the bundle (in case we get a 503); defaults to false */ "reFetchBundle"?: boolean; /** * Enable screen recording with New Relic. Note: not to be used in production unless for temporary use to track down a specific user problem. Defaults to false */ "recordScreen"?: boolean; /** * If screen recording enabled for debug purposes, use this property to provide a unique identifer for the user whose session is being recorded. */ "recordScreenIdentity"?: string; /** * If the item contains a passage, the player will render it by default. Set this property to false to not render passage. */ "renderStimulus"?: boolean; /** * Maximum time in milliseconds to wait for a response before aborting the request. Used to prevent requests from hanging indefinitely in poor network conditions. Default: 10000 (10 seconds) */ "requestTimeoutMs"?: number; /** * If provided, will load the assessment session identified by the id. An assessment session is the record of a student's interaction with the item. The player will immediately load the assessment session when this property is set. */ "sessionId"?: string; /** * In evaluate mode, add a bottom border to visually separate each item in the case of a multi-item */ "showBottomBorder"?: boolean; /** * A JWT token to authorize requests on behalf of the player. This token for accessing pie-api can be generated with a valid Api Client Id and Secret. */ "token"?: string; /** * Enable tracking page actions/events with New Relic. Note: Setting this to true increases data sent to New Relic, which may affect costs. */ "trackPageActions"?: boolean; } interface TokenHelper { } interface IntrinsicElements { "enter-token": EnterToken; "error-message": ErrorMessage; "pie-api-author": PieApiAuthor; "pie-api-player": PieApiPlayer; "token-helper": TokenHelper; } } export { LocalJSX as JSX }; declare module "@stencil/core" { export namespace JSX { interface IntrinsicElements { "enter-token": LocalJSX.EnterToken & JSXBase.HTMLAttributes; "error-message": LocalJSX.ErrorMessage & JSXBase.HTMLAttributes; "pie-api-author": LocalJSX.PieApiAuthor & JSXBase.HTMLAttributes; "pie-api-player": LocalJSX.PieApiPlayer & JSXBase.HTMLAttributes; "token-helper": LocalJSX.TokenHelper & JSXBase.HTMLAttributes; } } }