|
| 1 | +import { CSSResult } from 'lit'; |
| 2 | +import { LitElement } from 'lit'; |
| 3 | +import { marked } from 'marked'; |
| 4 | +import { PluginFunction } from 'reveal.js'; |
| 5 | +import { default as Reveal_2 } from 'reveal.js'; |
| 6 | +import { RootPart } from 'lit-html'; |
| 7 | +import { TemplateResult } from 'lit-html'; |
| 8 | + |
| 9 | +export declare function featherIconPack(): MarkedTcIconsOptions; |
| 10 | + |
| 11 | +export declare function fontAwesomeIconPack(): MarkedTcIconsOptions; |
| 12 | + |
| 13 | +/** |
| 14 | + * Since CSS makes use of data-* attributes, we need to persist URL parameters there, giving |
| 15 | + * them priority over anything that would already be there. |
| 16 | + * @param {*} urlParams = new URLSearchParams(window.location.search) |
| 17 | + * @param {*} queryParam = Search parameter (theme, type, data-lang) |
| 18 | + * @param {*} slidesElement = the html Elements corresponding to the slides |
| 19 | + * @param {*} htmlParam = the data-* attribute to set (data-theme-slides, data-type-show, data-lang) |
| 20 | + * @param {*} defaultValue the default value of the attribute |
| 21 | + * @returns |
| 22 | + */ |
| 23 | +export declare function _handle_parameter(urlParams: URLSearchParams, queryParam: string, slidesElement: HTMLElement, htmlParam: string, defaultValue: string): string; |
| 24 | + |
| 25 | +declare interface MarkedTcIconsOptions { |
| 26 | + /** |
| 27 | + * Copy icon Keyword to identify the copy icon |
| 28 | + */ |
| 29 | + copyKeyword: string; |
| 30 | + /** |
| 31 | + * Keyword to identify the icon to use |
| 32 | + */ |
| 33 | + keyword: string; |
| 34 | + /** |
| 35 | + * true if we have to se the keyword in final tag (default false) |
| 36 | + */ |
| 37 | + includesKeyword?: boolean; |
| 38 | + /** |
| 39 | + * set the html attribute to use for the main tag |
| 40 | + */ |
| 41 | + htmlAttribute: string; |
| 42 | + /** |
| 43 | + * true if the value of icon (draw to use) should be in the innerHTML of the tag (default false) |
| 44 | + */ |
| 45 | + iconInTag?: boolean; |
| 46 | + /** |
| 47 | + * function that could be called to init the icons after the parsing |
| 48 | + * @returns |
| 49 | + */ |
| 50 | + initFunction?: () => void; |
| 51 | +} |
| 52 | + |
| 53 | +export declare function materialSymbolsIconPack(): MarkedTcIconsOptions; |
| 54 | + |
| 55 | +export { Reveal_2 as Reveal } |
| 56 | + |
| 57 | +declare interface RevealConfig { |
| 58 | + navigationMode?: 'linear' | 'grid'; |
| 59 | +} |
| 60 | + |
| 61 | +export declare interface RevealMarkdownPlugin { |
| 62 | + id: string; |
| 63 | + marked: { |
| 64 | + use: (ext: marked.MarkedExtension) => void; |
| 65 | + }; |
| 66 | + init(reveal: Reveal_2.Api): void | Promise<unknown>; |
| 67 | + processSlides(): void; |
| 68 | + convertSlides(): void; |
| 69 | + slidify(): void; |
| 70 | +} |
| 71 | + |
| 72 | +export declare interface SlidePath { |
| 73 | + path: string; |
| 74 | +} |
| 75 | + |
| 76 | +export declare interface SlideTreeEntry { |
| 77 | + prefix: string; |
| 78 | + path: string; |
| 79 | + index: number; |
| 80 | + check: boolean; |
| 81 | +} |
| 82 | + |
| 83 | +declare interface TalkControlMarkedOptions { |
| 84 | + fontIcons?: MarkedTcIconsOptions[]; |
| 85 | + knowStyles?: string[]; |
| 86 | +} |
| 87 | + |
| 88 | +export declare class TcConfiguratorElement extends LitElement { |
| 89 | + static shadowRootOptions: { |
| 90 | + delegatesFocus: boolean; |
| 91 | + mode: ShadowRootMode; |
| 92 | + serializable?: boolean; |
| 93 | + slotAssignment?: SlotAssignmentMode; |
| 94 | + }; |
| 95 | + slides: SlideTreeEntry[]; |
| 96 | + theme: string; |
| 97 | + defaultTheme: string; |
| 98 | + type: string; |
| 99 | + defaultType: string; |
| 100 | + i18n: string; |
| 101 | + defaultI18n: string; |
| 102 | + revealOptions: Record<string, unknown>; |
| 103 | + private selectedTab; |
| 104 | + private isApplying; |
| 105 | + render(): TemplateResult<1>; |
| 106 | + selectTab(tab: 'talk-control' | 'revealjs'): void; |
| 107 | + private handleTabKeydown; |
| 108 | + private handleCloseKeydown; |
| 109 | + private onConfigChanged; |
| 110 | + /** |
| 111 | + * Handler method that deals with the apply button. it will refresh the page |
| 112 | + */ |
| 113 | + applyConfiguration(): void; |
| 114 | + private buildConfigurationUrl; |
| 115 | + closeUI(): void; |
| 116 | + static styles: CSSResult; |
| 117 | +} |
| 118 | + |
| 119 | +declare interface TcCustomBackgroundMap { |
| 120 | + [key: string]: string; |
| 121 | +} |
| 122 | + |
| 123 | +declare interface TcCustomBackgroundOptions { |
| 124 | + basePath: string; |
| 125 | + mapBackgrounds: (theme?: string) => TcCustomBackgroundMap; |
| 126 | +} |
| 127 | + |
| 128 | +declare interface TcI18nConfig { |
| 129 | + baseMarkdownPath: string; |
| 130 | + defaultLang?: string; |
| 131 | +} |
| 132 | + |
| 133 | +export declare class TcRevealjsElement extends LitElement { |
| 134 | + revealOptions: RevealConfig; |
| 135 | + private shortcuts; |
| 136 | + private editMode; |
| 137 | + static styles: CSSResult; |
| 138 | + protected firstUpdated(): void; |
| 139 | + protected updated(changedProperties: Map<string | number | symbol, unknown>): void; |
| 140 | + private updateShortcuts; |
| 141 | + private handleNavigationModeChange; |
| 142 | + private handleShortcutChange; |
| 143 | + render(): TemplateResult<1>; |
| 144 | + renderFooterEdit(): TemplateResult<1>; |
| 145 | +} |
| 146 | + |
| 147 | +export declare class TcTalkControlElement extends LitElement { |
| 148 | + static shadowRootOptions: { |
| 149 | + delegatesFocus: boolean; |
| 150 | + mode: ShadowRootMode; |
| 151 | + serializable?: boolean; |
| 152 | + slotAssignment?: SlotAssignmentMode; |
| 153 | + }; |
| 154 | + slides: SlideTreeEntry[]; |
| 155 | + theme: string; |
| 156 | + defaultTheme: string; |
| 157 | + type: string; |
| 158 | + defaultType: string; |
| 159 | + i18n: string; |
| 160 | + defaultI18n: string; |
| 161 | + private validationErrors; |
| 162 | + private isDirty; |
| 163 | + render(): TemplateResult<1>; |
| 164 | + private onSlideSelected; |
| 165 | + private onThemeInput; |
| 166 | + private onLanguageInput; |
| 167 | + private onTypeInput; |
| 168 | + private onFormInput; |
| 169 | + private onFormChange; |
| 170 | + private markAsDirty; |
| 171 | + private emitConfigChange; |
| 172 | + /** |
| 173 | + * Validation du thème |
| 174 | + */ |
| 175 | + private validateTheme; |
| 176 | + /** |
| 177 | + * Validation de la langue |
| 178 | + */ |
| 179 | + private validateLanguage; |
| 180 | + /** |
| 181 | + * Validation du type |
| 182 | + */ |
| 183 | + private validateType; |
| 184 | + /** |
| 185 | + * Validation complète du formulaire |
| 186 | + */ |
| 187 | + private validateForm; |
| 188 | + /** |
| 189 | + * Vérifier si le formulaire est valide |
| 190 | + */ |
| 191 | + private isFormValid; |
| 192 | + /** |
| 193 | + * Définir une erreur de validation |
| 194 | + */ |
| 195 | + private setValidationError; |
| 196 | + /** |
| 197 | + * Effacer une erreur de validation |
| 198 | + */ |
| 199 | + private clearValidationError; |
| 200 | + /** |
| 201 | + * Gestion générale des erreurs |
| 202 | + */ |
| 203 | + private handleError; |
| 204 | + /** |
| 205 | + * Méthode publique pour réinitialiser le formulaire |
| 206 | + */ |
| 207 | + resetForm(): void; |
| 208 | + /** |
| 209 | + * Méthode publique pour valider le formulaire |
| 210 | + */ |
| 211 | + validate(): boolean; |
| 212 | + /** |
| 213 | + * Méthode publique pour obtenir la configuration actuelle |
| 214 | + */ |
| 215 | + getConfiguration(): { |
| 216 | + theme: string; |
| 217 | + i18n: string; |
| 218 | + type: string; |
| 219 | + slides: SlideTreeEntry[]; |
| 220 | + isValid: boolean; |
| 221 | + isDirty: boolean; |
| 222 | + }; |
| 223 | + /** |
| 224 | + * Gestion du focus initial |
| 225 | + */ |
| 226 | + firstUpdated(): void; |
| 227 | + static styles: CSSResult; |
| 228 | +} |
| 229 | + |
| 230 | +declare interface TcThemeOptions { |
| 231 | + defaultTheme?: string; |
| 232 | +} |
| 233 | + |
| 234 | +/** |
| 235 | + * The tree checkbox element |
| 236 | + * |
| 237 | + * @csspart button - The button |
| 238 | + */ |
| 239 | +export declare class TcTreeSlidesElement extends LitElement { |
| 240 | + slides: SlideTreeEntry[]; |
| 241 | + private treeArray; |
| 242 | + render(): TemplateResult<1>; |
| 243 | + /** |
| 244 | + * |
| 245 | + * @param {*} key the prefix of the tree. Key could be a path if no prefix |
| 246 | + * @param {*} value the array of path under the prefix. Value could be null if no prefix. |
| 247 | + * @returns the render litHTML Method |
| 248 | + */ |
| 249 | + renderTreeElement(key: string | SlideTreeEntry, value?: SlideTreeEntry[] | undefined): TemplateResult<1>; |
| 250 | + /** |
| 251 | + * Method that render a leaf of the tree |
| 252 | + * @param {*} slide : a slide element with path, index, check, prefix |
| 253 | + * @returns the render method |
| 254 | + */ |
| 255 | + renderLiElement(slide: SlideTreeEntry): TemplateResult<1>; |
| 256 | + /** |
| 257 | + * Handler method that deals with the checkbox of the prefix. |
| 258 | + * This method will update the state and the session storage and reset the UI |
| 259 | + * @param {*} event : click event |
| 260 | + * @param {*} prefix : the prefix of the slides (to update the state of children slides) |
| 261 | + */ |
| 262 | + checkPrefix(event: InputEvent, prefix: string): void; |
| 263 | + /** |
| 264 | + * Handler method that deals with the checkbox of a slide. |
| 265 | + * This method will update the state and the session storage and reset the UI |
| 266 | + * @param {*} event : click event |
| 267 | + * @param {*} index : the index of the slide in the state |
| 268 | + */ |
| 269 | + checkSlide(event: InputEvent, index: number): void; |
| 270 | + /** |
| 271 | + * |
| 272 | + * Utilities methods |
| 273 | + */ |
| 274 | + fireSlidesSelected(): void; |
| 275 | + /** |
| 276 | + * Method to recalculate the slides |
| 277 | + */ |
| 278 | + recalculateSlides(): void; |
| 279 | + /** |
| 280 | + * Transform the slides array to a tree structure to render it |
| 281 | + * it will only allow a one level tree depth. |
| 282 | + * |
| 283 | + * All the path with no prefix will be in the first element of the array |
| 284 | + * @returns the tree structure of slides in an array |
| 285 | + */ |
| 286 | + createTreeFromSlides(slidesEntries: SlideTreeEntry[]): (SlideTreeEntry[] | [string, SlideTreeEntry[]])[]; |
| 287 | + static styles: CSSResult; |
| 288 | +} |
| 289 | + |
| 290 | +export declare const ThemeInitializer: { |
| 291 | + /** |
| 292 | + * @param {() => Array.<string>} slidesFactory |
| 293 | + */ |
| 294 | + init({ activeCopyClipboard, slidesFactory, tcMarkedOptions, tcI18nOptions, tcCustomBackgroundOptions, tcThemeOptions, defaultSlidesType, slidesRenderer, plugins, }: ThemeInitializerOptions): Promise<void>; |
| 295 | +}; |
| 296 | + |
| 297 | +/** |
| 298 | + * |
| 299 | + */ |
| 300 | +export declare interface ThemeInitializerOptions { |
| 301 | + slidesFactory: (showType?: string) => SlidePath[]; |
| 302 | + activeCopyClipboard?: boolean; |
| 303 | + tcMarkedOptions?: TalkControlMarkedOptions; |
| 304 | + tcI18nOptions?: TcI18nConfig; |
| 305 | + tcCustomBackgroundOptions?: TcCustomBackgroundOptions; |
| 306 | + tcThemeOptions?: TcThemeOptions; |
| 307 | + slidesRenderer?: (element: HTMLElement, slides: SlidePath[]) => RootPart; |
| 308 | + defaultSlidesType?: string; |
| 309 | + plugins?: PluginFunction[]; |
| 310 | +} |
| 311 | + |
| 312 | +export { } |
| 313 | + |
| 314 | + |
| 315 | +declare global { |
| 316 | + interface HTMLElementTagNameMap { |
| 317 | + 'tc-tree-slides-element': TcTreeSlidesElement; |
| 318 | + } |
| 319 | +} |
| 320 | + |
| 321 | + |
| 322 | +declare global { |
| 323 | + interface HTMLElementTagNameMap { |
| 324 | + 'tc-talk-control-element': TcTalkControlElement; |
| 325 | + } |
| 326 | +} |
| 327 | + |
| 328 | + |
| 329 | +declare global { |
| 330 | + interface HTMLElementTagNameMap { |
| 331 | + 'tc-configurator-element': TcConfiguratorElement; |
| 332 | + } |
| 333 | +} |
| 334 | + |
| 335 | + |
| 336 | +declare global { |
| 337 | + interface HTMLElementTagNameMap { |
| 338 | + 'tc-revealjs-element': TcRevealjsElement; |
| 339 | + } |
| 340 | +} |
0 commit comments