@slidev/types 0.47.5 → 0.48.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +56 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ComputedRef } from '@vue/reactivity';
|
|
1
2
|
import { TransitionGroupProps, App, Ref } from 'vue';
|
|
2
3
|
import { Awaitable } from '@antfu/utils';
|
|
3
4
|
import * as monaco from 'monaco-editor';
|
|
@@ -397,6 +398,60 @@ type PreparserExtensionLoader = (headmatter?: Record<string, unknown>, filepath?
|
|
|
397
398
|
type PreparserExtensionFromHeadmatter = (headmatter: any, exts: SlidevPreparserExtension[], filepath?: string) => Promise<SlidevPreparserExtension[]>;
|
|
398
399
|
type RenderContext = 'slide' | 'overview' | 'presenter' | 'previewNext';
|
|
399
400
|
type LoadedSnippets = Record<string, string>;
|
|
401
|
+
type ClicksElement = Element | string;
|
|
402
|
+
type ClicksRelativeEls = Map<ClicksElement, number>;
|
|
403
|
+
interface ClicksInfo {
|
|
404
|
+
/**
|
|
405
|
+
* The maximum clicks, used to calculate the total clicks for current slide
|
|
406
|
+
*/
|
|
407
|
+
max?: number;
|
|
408
|
+
/**
|
|
409
|
+
* The offsets added to the subsequent clicks
|
|
410
|
+
* Delta is 0 when the click is absolute
|
|
411
|
+
*/
|
|
412
|
+
delta: number;
|
|
413
|
+
/**
|
|
414
|
+
* Resolved clicks
|
|
415
|
+
*/
|
|
416
|
+
clicks?: number | [number, number];
|
|
417
|
+
/**
|
|
418
|
+
* Computed ref of whether the click is exactly matched
|
|
419
|
+
*/
|
|
420
|
+
isCurrent?: ComputedRef<boolean>;
|
|
421
|
+
/**
|
|
422
|
+
* Computed ref of whether the click is active
|
|
423
|
+
*/
|
|
424
|
+
isActive?: ComputedRef<boolean>;
|
|
425
|
+
/**
|
|
426
|
+
* Computed ref of whether the click is shown, it take flagHide into account
|
|
427
|
+
*/
|
|
428
|
+
isShown?: ComputedRef<boolean>;
|
|
429
|
+
/**
|
|
430
|
+
* Having the hide flag
|
|
431
|
+
*/
|
|
432
|
+
flagHide?: boolean;
|
|
433
|
+
/**
|
|
434
|
+
* Having the fade flag
|
|
435
|
+
*/
|
|
436
|
+
flagFade?: boolean;
|
|
437
|
+
}
|
|
438
|
+
type ResolvedClicksInfo = Required<ClicksInfo>;
|
|
439
|
+
type ClicksMap = Map<ClicksElement, ClicksInfo>;
|
|
440
|
+
interface ClicksContext {
|
|
441
|
+
readonly disabled: boolean;
|
|
442
|
+
readonly current: number;
|
|
443
|
+
readonly relativeOffsets: ClicksRelativeEls;
|
|
444
|
+
readonly map: ClicksMap;
|
|
445
|
+
resolve: (at: string | number, size?: number) => {
|
|
446
|
+
start: number;
|
|
447
|
+
end: number;
|
|
448
|
+
delta: number;
|
|
449
|
+
};
|
|
450
|
+
register: (el: ClicksElement, info: ClicksInfo) => void;
|
|
451
|
+
unregister: (el: ClicksElement) => void;
|
|
452
|
+
readonly currentOffset: number;
|
|
453
|
+
readonly total: number;
|
|
454
|
+
}
|
|
400
455
|
|
|
401
456
|
interface AppContext {
|
|
402
457
|
app: App;
|
|
@@ -469,4 +524,4 @@ interface TocItem {
|
|
|
469
524
|
title?: string;
|
|
470
525
|
}
|
|
471
526
|
|
|
472
|
-
export { type AppContext, type AppSetup, type BuildArgs, type BuiltinSlideTransition, type CommonArgs, type DrawingsOptions, type ExportArgs, type FontOptions, type FrontmatterStyle, type KatexSetup, type LoadedSnippets, type MermaidOptions, type MermaidSetup, type MonacoSetup, type MonacoSetupReturn, type NavOperations, type PreparserExtensionFromHeadmatter, type PreparserExtensionLoader, type PreparserSetup, type RenderContext, type ResolvedDrawingsOptions, type ResolvedExportOptions, type ResolvedFontOptions, type ShikiContext, type ShikiSetup, type ShikiSetupReturn, type ShortcutOptions, type ShortcutsSetup, type SlideInfo, type SlideInfoBase, type SlideInfoExtended, type SlideInfoWithPath, type SlidevConfig, type SlidevFeatureFlags, type SlidevMarkdown, type SlidevPreparserExtension, type SlidevThemeConfig, type SlidevThemeMeta, type TocItem, type UnoSetup, defineAppSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineShikiSetup, defineShortcutsSetup, defineUnoSetup };
|
|
527
|
+
export { type AppContext, type AppSetup, type BuildArgs, type BuiltinSlideTransition, type ClicksContext, type ClicksElement, type ClicksInfo, type ClicksMap, type ClicksRelativeEls, type CommonArgs, type DrawingsOptions, type ExportArgs, type FontOptions, type FrontmatterStyle, type KatexSetup, type LoadedSnippets, type MermaidOptions, type MermaidSetup, type MonacoSetup, type MonacoSetupReturn, type NavOperations, type PreparserExtensionFromHeadmatter, type PreparserExtensionLoader, type PreparserSetup, type RenderContext, type ResolvedClicksInfo, type ResolvedDrawingsOptions, type ResolvedExportOptions, type ResolvedFontOptions, type ShikiContext, type ShikiSetup, type ShikiSetupReturn, type ShortcutOptions, type ShortcutsSetup, type SlideInfo, type SlideInfoBase, type SlideInfoExtended, type SlideInfoWithPath, type SlidevConfig, type SlidevFeatureFlags, type SlidevMarkdown, type SlidevPreparserExtension, type SlidevThemeConfig, type SlidevThemeMeta, type TocItem, type UnoSetup, defineAppSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineShikiSetup, defineShortcutsSetup, defineUnoSetup };
|