Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Visibility for templating and setRenderer #377

Open
ALJCepeda opened this issue Apr 5, 2019 · 1 comment
Open

Visibility for templating and setRenderer #377

ALJCepeda opened this issue Apr 5, 2019 · 1 comment

Comments

@ALJCepeda
Copy link

ALJCepeda commented Apr 5, 2019

Wondering why documentation for templates is hidden in https://github.com/linkedin/hopscotch/tree/master/src/tl and no mention within documentation at http://linkedin.github.io/hopscotch/

Are these methods not expected to be public?

It seems like providing templates for bubbles is a pretty typical use case. It would be useful to include a template property in the TourDefinition and StepDefinition interfaces. If a template isn't provided then should use default template.

Also setRenderer isn't defined on the type for Hopscotch https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/hopscotch/index.d.ts#L81-L161

@ALJCepeda
Copy link
Author

ALJCepeda commented Apr 5, 2019

I figure the types would look something like this:

export interface RenderOptions {
  i18n: {
    prevBtn: string,
    nextBtn: string,
    closeTooltip: string,
    stepNum: number,
    numSteps: number
  },
  buttons:{
    showPrev: boolean,
    showNext: boolean,
    showCTA: boolean,
    ctaLabel: string,
    showClose: boolean
  },
  step:{
    num: number,
    isLast: boolean,
    title: string,
    content: string,
    isRtl: boolean,
    placement: string,
    padding: string,
    width: string,
    customData: { [key:string]:any }
  },
  tour:{
    isTour: boolean,
    numSteps: number,
    unsafe: boolean,
    customData: { [key:string]:any }
  }
}

export interface HopscotchStatic {
  setRenderer: ( renderer:string | ((ops:RenderOptions) => void) ) => void
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant