diff --git a/src/@types/index.d.ts b/src/@types/index.d.ts index 14ff867..ad2de30 100644 --- a/src/@types/index.d.ts +++ b/src/@types/index.d.ts @@ -9,7 +9,7 @@ interface QueryString { embed: boolean; export: boolean; } -export interface AdvancedSlidesSettings { +export interface SlidesExtendedSettings { port: string; autoReload: boolean; autoStart: boolean; diff --git a/src/advancedSlides-Plugin.ts b/src/advancedSlides-Plugin.ts index f747c51..184b365 100644 --- a/src/advancedSlides-Plugin.ts +++ b/src/advancedSlides-Plugin.ts @@ -1,5 +1,5 @@ import { addIcon, Plugin, TAbstractFile } from 'obsidian'; -import { AdvancedSlidesSettings } from './@types'; +import { SlidesExtendedSettings } from './@types'; import { RevealServer } from './reveal/revealServer'; import { ObsidianUtils } from './obsidian/obsidianUtils'; import { AutoCompleteSuggest } from './obsidian/suggesters/AutoCompleteSuggester'; @@ -18,7 +18,7 @@ import { EmbeddedSlideProcessor } from './obsidian/embeddedSlideProcessor'; import { AdvancedSlidesDistribution } from './advancedSlides-Distribution'; export class AdvancedSlidesPlugin extends Plugin { - settings: AdvancedSlidesSettings; + settings: SlidesExtendedSettings; obsidianUtils: ObsidianUtils; private revealServer: RevealServer; @@ -273,7 +273,7 @@ export class AdvancedSlidesPlugin extends Plugin { } } - async update(newSettings: AdvancedSlidesSettings) { + async update(newSettings: SlidesExtendedSettings) { this.settings = newSettings; await this.saveSettings(); } diff --git a/src/advancedSlides-SettingTab.ts b/src/advancedSlides-SettingTab.ts index cd262f6..f316975 100644 --- a/src/advancedSlides-SettingTab.ts +++ b/src/advancedSlides-SettingTab.ts @@ -11,7 +11,7 @@ import { getThemeFiles, } from './obsidian/suggesters/ThemeSuggester'; import { AdvancedSlidesPlugin } from './advancedSlides-Plugin'; -import { AdvancedSlidesSettings } from './@types'; +import { SlidesExtendedSettings } from './@types'; /** This is because TypeScript's filters are dumb. */ function isFolder(file: TAbstractFile): file is TFolder { @@ -19,7 +19,7 @@ function isFolder(file: TAbstractFile): file is TFolder { } export class AdvancedSlidesSettingTab extends PluginSettingTab { plugin: AdvancedSlidesPlugin; - newSettings: AdvancedSlidesSettings; + newSettings: SlidesExtendedSettings; constructor(app: App, plugin: AdvancedSlidesPlugin) { super(app, plugin); diff --git a/src/advancedSlides-constants.ts b/src/advancedSlides-constants.ts index 058e794..cdf6a5a 100644 --- a/src/advancedSlides-constants.ts +++ b/src/advancedSlides-constants.ts @@ -1,4 +1,4 @@ -import { AdvancedSlidesSettings, ImageCollector, Options } from './@types'; +import { SlidesExtendedSettings, ImageCollector, Options } from './@types'; export const ICON_DATA = ''; @@ -6,7 +6,7 @@ export const ICON_DATA = export const REFRESH_ICON = ''; -export const DEFAULT_SETTINGS: AdvancedSlidesSettings = { +export const DEFAULT_SETTINGS: SlidesExtendedSettings = { port: '3000', autoReload: true, autoStart: true, diff --git a/src/obsidian/obsidianUtils.ts b/src/obsidian/obsidianUtils.ts index 6d6c195..046b835 100644 --- a/src/obsidian/obsidianUtils.ts +++ b/src/obsidian/obsidianUtils.ts @@ -1,7 +1,10 @@ import { readFileSync } from 'fs-extra'; import { App, FileSystemAdapter, resolveSubpath, TFile } from 'obsidian'; import path from 'path'; -import { AdvancedSlidesSettings, ImageCollector } from '../@types'; +import { + SlidesExtendedSettings as SlidesExtendedSettings, + ImageCollector, +} from '../@types'; import { DISABLED_IMAGE_COLLECTOR } from '../advancedSlides-constants'; import { MarkdownProcessor } from './markdownProcessor'; @@ -17,7 +20,7 @@ function setImageCollector(newInstance: ImageCollector) { export class ObsidianUtils implements ImageCollector { private app: App; private fileSystem: FileSystemAdapter; - private settings: AdvancedSlidesSettings; + private settings: SlidesExtendedSettings; private readonly processor: MarkdownProcessor; private readonly vaultDir; private readonly pluginDir; @@ -32,7 +35,7 @@ export class ObsidianUtils implements ImageCollector { private yamlRegex = /^---.*?---\n(.*?)($|---)/s; - constructor(app: App, settings: AdvancedSlidesSettings) { + constructor(app: App, settings: SlidesExtendedSettings) { this.app = app; if (!(this.app.vault.adapter instanceof FileSystemAdapter)) { throw new Error('Slides Extended is only supported on the desktop'); @@ -112,7 +115,7 @@ export class ObsidianUtils implements ImageCollector { return this.highlightSearchPath; } - getSettings(): AdvancedSlidesSettings { + getSettings(): SlidesExtendedSettings { return this.settings; } diff --git a/src/reveal/revealPreviewView.ts b/src/reveal/revealPreviewView.ts index d84bbf5..22035fd 100644 --- a/src/reveal/revealPreviewView.ts +++ b/src/reveal/revealPreviewView.ts @@ -1,6 +1,6 @@ import { ItemView, MarkdownView, Menu, WorkspaceLeaf } from 'obsidian'; import { YamlParser } from '../yaml/yamlParser'; -import { AdvancedSlidesSettings, Options } from '../@types'; +import { SlidesExtendedSettings, Options } from '../@types'; export const REVEAL_PREVIEW_VIEW = 'reveal-preview-view'; @@ -15,7 +15,7 @@ export class RevealPreviewView extends ItemView { constructor( leaf: WorkspaceLeaf, home: URL, - settings: AdvancedSlidesSettings, + settings: SlidesExtendedSettings, onCloseListener: () => void, ) { super(leaf); diff --git a/src/yaml/yamlParser.ts b/src/yaml/yamlParser.ts index f837a95..61eca0d 100644 --- a/src/yaml/yamlParser.ts +++ b/src/yaml/yamlParser.ts @@ -1,13 +1,13 @@ import { loadFront } from 'yaml-front-matter'; import { isEmpty, isNil, omit, omitBy, pick } from '../util'; -import { AdvancedSlidesSettings, Options } from '../@types'; +import { SlidesExtendedSettings, Options } from '../@types'; import { DEFAULTS } from '../advancedSlides-constants'; export class YamlParser { - private settings: AdvancedSlidesSettings; + private settings: SlidesExtendedSettings; - constructor(settings: AdvancedSlidesSettings) { + constructor(settings: SlidesExtendedSettings) { this.settings = settings; }