Skip to content

Commit

Permalink
fix some incito kit types
Browse files Browse the repository at this point in the history
  • Loading branch information
klarstrup committed Sep 9, 2024
1 parent 37eaeec commit ec5a373
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions lib/kits/incito-publication/bootstrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ function getLocale() {

interface BootstrapperInit {
el: HTMLElement;
id: string;
apiKey: string;
coreUrl: string;
id?: string;
apiKey?: string;
coreUrl?: string;
eventTracker: Tracker;
}
export default class Bootstrapper {
Expand All @@ -82,7 +82,7 @@ export default class Bootstrapper {
getFeatureLabels() {
const regex = new RegExp(/tjek_audience=[^#&;+]+/);
const match = regex.exec(location.href) || [];
let feature;
let feature: string[];

if (match.length > 0) {
feature =
Expand Down Expand Up @@ -127,6 +127,12 @@ export default class Bootstrapper {
) => void
) {
try {
if (!this.options.id) {
throw new Error(
'You need to supply a valid id to use Bootstrapper#fetch'
);
}

const {0: details, 1: incito} = await Promise.all([
this.fetchDetails(this.options.id),
this.fetchIncito(this.options.id)
Expand Down Expand Up @@ -190,7 +196,7 @@ export default class Bootstrapper {
callback
);

createViewer({details, incito}) {
createViewer({details, incito}: {details?: V2Catalog; incito: IIncito}) {
const self = this;

if (!incito) {
Expand Down
4 changes: 2 additions & 2 deletions lib/kits/incito-publication/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import './viewer.styl';

interface ViewerInit {
incito: IIncito;
eventTracker: Tracker;
details: V2Catalog;
eventTracker?: Tracker;
details?: V2Catalog;
}
class Viewer extends MicroEvent {
static Incito = Incito;
Expand Down

0 comments on commit ec5a373

Please sign in to comment.