import { App , Setting , TFile } from "obsidian" ; import Homepage from "./main" ; import { View } from "./settings" ; export function trimFile ( file ) { return file . path . slice ( 0 , - 3 ) ; } export function wrapAround ( value , size ) { return ( ( value % size ) + size ) % size ; } ; export function getWorkspacePlugin ( app ) { return ( < any > app ) ?. internalPlugins ?. plugins ?. workspaces ; } ; export function disableSetting ( setting ) { setting . settingEl . setAttribute ( "style" , "opacity: .5; pointer-events: none !important" ) ; } export async function upgradeSettings ( plugin ) { plugin . settings . workspace = plugin . settings . defaultNote ; if ( ( plugin . settings as any ) . alwaysPreview ) { plugin . settings . openMode = View . Reading ; } plugin . settings . version = 2 ; await plugin . saveSettings ( ) ; }