yanki 2.0.15 → 3.0.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.
@@ -0,0 +1,2 @@
1
+ import e from"node:process";import t from"node:fs";import n from"node:path";import{promisify as r}from"node:util";import i,{execFile as a}from"node:child_process";import{fileURLToPath as o}from"node:url";import s,{constants as c}from"node:fs/promises";import l from"node:os";import{Buffer as u}from"node:buffer";let d;function f(){try{return t.statSync(`/.dockerenv`),!0}catch{return!1}}function p(){try{return t.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`docker`)}catch{return!1}}function ee(){return d===void 0&&(d=f()||p()),d}let m;const te=()=>{try{return t.statSync(`/run/.containerenv`),!0}catch{return!1}};function h(){return m===void 0&&(m=te()||ee()),m}const g=()=>{if(e.platform!==`linux`)return!1;if(l.release().toLowerCase().includes(`microsoft`))return!h();try{if(t.readFileSync(`/proc/version`,`utf8`).toLowerCase().includes(`microsoft`))return!h()}catch{}return t.existsSync(`/proc/sys/fs/binfmt_misc/WSLInterop`)||t.existsSync(`/run/WSL`)?!h():!1};var _=e.env.__IS_WSL_TEST__?g:g();const v=r(i.execFile),y=()=>`${e.env.SYSTEMROOT||e.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,b=async(e,t={})=>{let{powerShellPath:n,...r}=t,i=b.encodeCommand(e);return v(n??y(),[...b.argumentsPrefix,i],{encoding:`utf8`,...r})};b.argumentsPrefix=[`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`],b.encodeCommand=e=>u.from(e,`utf16le`).toString(`base64`),b.escapeArgument=e=>`'${String(e).replaceAll(`'`,`''`)}'`;function ne(e){for(let t of e.split(`
2
+ `)){if(/^\s*#/.test(t))continue;let e=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(e)return e.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,``)}}const re=r(i.execFile),ie=(()=>{let e=`/mnt/`,t;return async function(){if(t)return t;let n=`/etc/wsl.conf`,r=!1;try{await s.access(n,c.F_OK),r=!0}catch{}if(!r)return e;let i=ne(await s.readFile(n,{encoding:`utf8`}));return i===void 0?e:(t=i,t=t.endsWith(`/`)?t:`${t}/`,t)}})(),x=_?async()=>`${await ie()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:y;let S;const ae=async()=>(S??=(async()=>{try{let e=await x();return await s.access(e,c.X_OK),!0}catch{return!1}})(),S),C=async()=>{let e=await x(),t=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:r}=await b(t,{powerShellPath:e,cwd:n.dirname(e)});return r.trim()},w=e=>/^[a-z]+:\/\//i.test(e),T=async e=>{let t=Array.isArray(e),n=t?e:[e],r=[],i=[];for(let[e,t]of n.entries())w(t)||(r.push(e),i.push(t));let a=[...n];if(i.length>0)try{let{stdout:e}=await re(`wslpath`,[`-aw`,...i],{encoding:`utf8`}),t=e.split(/\r?\n/).filter(Boolean);for(let[e,i]of r.entries())a[i]=t[e]??n[i]}catch{}return t?a:a[0]},oe=r(i.execFile),se=()=>`${e.env.SYSTEMROOT||e.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,E=[`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`],D=e=>u.from(e,`utf16le`).toString(`base64`),ce=e=>`'${String(e).replaceAll(/['‘’‚‛]/g,e=>e+e)}'`,O=e=>[...E,D(e)],le=e=>({encoding:`utf8`,...e,shell:!1}),k=async(e,t={})=>{let{powerShellPath:n,...r}=t;return oe(n??se(),O(e),le(r))};k.argumentsPrefix=E,k.encodeCommand=D,k.escapeArgument=ce,k.createArguments=O;function A(e,t,n){let r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let e=n();return r(e),e},set(e){r(e)}}),e}const j=r(a);async function M(){if(e.platform!==`darwin`)throw Error(`macOS only`);let{stdout:t}=await j(`defaults`,[`read`,`com.apple.LaunchServices/com.apple.launchservices.secure`,`LSHandlers`]),n=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??`com.apple.Safari`;return n===`com.apple.safari`?`com.apple.Safari`:n}const N=r(a);async function P(t,{humanReadableOutput:n=!0,signal:r}={}){if(e.platform!==`darwin`)throw Error(`macOS only`);let i=n?[]:[`-ss`],a={};r&&(a.signal=r);let{stdout:o}=await N(`osascript`,[`-e`,t,i],a);return o.trim()}async function F(e){return P(`tell application "Finder" to set app_path to application file id "${e}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}const I=r(a),L={MSEdgeHTM:{name:`Edge`,id:`com.microsoft.edge`},MSEdgeBHTML:{name:`Edge Beta`,id:`com.microsoft.edge.beta`},MSEdgeDHTML:{name:`Edge Dev`,id:`com.microsoft.edge.dev`},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:`Edge`,id:`com.microsoft.edge.old`},ChromeHTML:{name:`Chrome`,id:`com.google.chrome`},ChromeBHTML:{name:`Chrome Beta`,id:`com.google.chrome.beta`},ChromeDHTML:{name:`Chrome Dev`,id:`com.google.chrome.dev`},ChromiumHTM:{name:`Chromium`,id:`org.chromium.Chromium`},BraveHTML:{name:`Brave`,id:`com.brave.Browser`},BraveBHTML:{name:`Brave Beta`,id:`com.brave.Browser.beta`},BraveDHTML:{name:`Brave Dev`,id:`com.brave.Browser.dev`},BraveSSHTM:{name:`Brave Nightly`,id:`com.brave.Browser.nightly`},FirefoxURL:{name:`Firefox`,id:`org.mozilla.firefox`},OperaStable:{name:`Opera`,id:`com.operasoftware.Opera`},VivaldiHTM:{name:`Vivaldi`,id:`com.vivaldi.Vivaldi`},"IE.HTTP":{name:`Internet Explorer`,id:`com.microsoft.ie`}},R=new Map(Object.entries(L));var z=class extends Error{};async function B(t=I){let{stdout:n}=await t(`${e.env.SYSTEMROOT??e.env.windir??`C:\\Windows`}\\System32\\reg.exe`,[`QUERY`,` HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice`,`/v`,`ProgId`]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(n);if(!r)throw new z(`Cannot find Windows browser in stdout: ${JSON.stringify(n)}`);let{id:i}=r.groups,a=i.lastIndexOf(`.`),o=i.lastIndexOf(`-`),s=a===-1?void 0:i.slice(0,a),c=o===-1?void 0:i.slice(0,o);return L[i]??L[s]??L[c]??{name:i,id:i}}const V=r(a),H=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase());async function U(){if(e.platform===`darwin`){let e=await M();return{name:await F(e),id:e}}if(e.platform===`linux`){let{stdout:e}=await V(`xdg-mime`,[`query`,`default`,`x-scheme-handler/http`]),t=e.trim();return{name:H(t.replace(/.desktop$/,``).replace(`-`,` `)),id:t}}if(e.platform===`win32`)return B();throw Error(`Only macOS, Linux, and Windows are supported`)}const ue=!!(e.env.SSH_CONNECTION||e.env.SSH_CLIENT||e.env.SSH_TTY),W=Symbol(`fallbackAttempt`),G=import.meta.url?n.dirname(o(import.meta.url)):``,K=n.join(G,`xdg-open`),{platform:q,arch:J}=e,Y=async(e,t)=>{if(e.length===0)return;let n=[];for(let r of e)try{return await t(r)}catch(e){n.push(e)}throw AggregateError(n,`Failed to open in all supported apps`)},X=async t=>{t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t};let r=t[W]===!0;if(delete t[W],Array.isArray(t.app))return Y(t.app,e=>X({...t,app:e,[W]:!0}));let{name:a,arguments:o=[]}=t.app??{};if(o=[...o],Array.isArray(a))return Y(a,e=>X({...t,app:{name:e,arguments:o},[W]:!0}));if(a===`browser`||a===`browserPrivate`){let e={"com.google.chrome":`chrome`,"google-chrome.desktop":`chrome`,"com.brave.browser":`brave`,"org.mozilla.firefox":`firefox`,"firefox.desktop":`firefox`,"com.microsoft.msedge":`edge`,"com.microsoft.edge":`edge`,"com.microsoft.edgemac":`edge`,"microsoft-edge.desktop":`edge`,"com.apple.safari":`safari`},n={chrome:`--incognito`,brave:`--incognito`,firefox:`--private-window`,edge:`--inPrivate`},r;if(_){let e=await C();r=R.get(e)??{}}else r=await U();if(Object.hasOwn(e,r.id)){let i=e[r.id.toLowerCase()];if(i===void 0)throw Error(`${r.name} is not supported as a default browser`);if(a===`browserPrivate`){if(i===`safari`)throw Error(`Safari doesn't support opening in private mode via command line`);o.push(n[i])}return X({...t,app:{name:$[i],arguments:o}})}throw Error(`${r.name} is not supported as a default browser`)}let l,u=[],d={},f=!1;if(_&&!h()&&!ue&&!a&&(f=await ae()),q===`darwin`)l=`open`,t.wait&&u.push(`--wait-apps`),t.background&&u.push(`--background`),t.newInstance&&u.push(`--new`),a&&u.push(`-a`,a);else if(q===`win32`||f){l=await x(),u.push(...k.argumentsPrefix),_||(d.windowsVerbatimArguments=!0),_&&t.target&&(t.target=await T(t.target));let e=[`$ProgressPreference = 'SilentlyContinue';`,`Start`];t.wait&&e.push(`-Wait`),a?(e.push(k.escapeArgument(a)),t.target&&o.push(t.target)):t.target&&e.push(k.escapeArgument(t.target)),o.length>0&&(o=o.map(e=>k.escapeArgument(e)),e.push(`-ArgumentList`,o.join(`,`))),t.target=k.encodeCommand(e.join(` `)),t.wait||(d.stdio=`ignore`),_&&(d.cwd=n.dirname(l))}else{if(a)l=a;else{let t=!G||G===`/`,n=!1;try{await s.access(K,c.X_OK),n=!0}catch{}l=e.versions.electron??(q===`android`||t||!n)?`xdg-open`:K}o.length>0&&u.push(...o),t.wait||(d.stdio=`ignore`,d.detached=!0)}q===`darwin`&&o.length>0&&u.push(`--args`,...o),t.target&&u.push(t.target);let p=i.spawn(l,u,d);return t.wait?new Promise((e,n)=>{p.once(`error`,n),p.once(`close`,r=>{if(!t.allowNonzeroExitCode&&r!==0){n(Error(`Exited with code ${r}`));return}e(p)})}):r||q===`win32`||f?new Promise((e,t)=>{p.once(`error`,t),p.once(`spawn`,()=>{p.once(`close`,n=>{if(p.off(`error`,t),r&&n!==0){t(Error(`Exited with code ${n}`));return}p.unref(),e(p)})})}):(p.unref(),new Promise((e,t)=>{p.once(`error`,t),p.once(`spawn`,()=>{p.off(`error`,t),e(p)})}))},de=(e,t)=>{if(typeof e!=`string`&&!Array.isArray(e))throw TypeError("Expected a valid `name`");let{arguments:n=[]}=t??{};if(n!=null&&!Array.isArray(n))throw TypeError("Expected `appArguments` as Array type");return X({...t,app:{name:e,arguments:n}})};function Z(e){if(typeof e==`string`||Array.isArray(e))return e;let{[J]:t}=e;if(!t)throw Error(`${J} is not supported`);return t}function Q({[q]:e},{wsl:t}={}){if(t&&_)return Z(t);if(!e)throw Error(`${q} is not supported`);return Z(e)}const $={browser:`browser`,browserPrivate:`browserPrivate`};A($,`chrome`,()=>Q({darwin:`google chrome`,win32:`chrome`,linux:[`google-chrome`,`google-chrome-stable`,`chromium`,`chromium-browser`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`,x64:[`/mnt/c/Program Files/Google/Chrome/Application/chrome.exe`,`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`]}})),A($,`brave`,()=>Q({darwin:`brave browser`,win32:`brave`,linux:[`brave-browser`,`brave`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`,x64:[`/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe`,`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`]}})),A($,`firefox`,()=>Q({darwin:`firefox`,win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:`firefox`},{wsl:`/mnt/c/Program Files/Mozilla Firefox/firefox.exe`})),A($,`edge`,()=>Q({darwin:`microsoft edge`,win32:`msedge`,linux:[`microsoft-edge`,`microsoft-edge-dev`]},{wsl:`/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe`})),A($,`safari`,()=>Q({darwin:`Safari`}));export{de as openApp};
@@ -130,7 +130,7 @@ type GlobalOptions = {
130
130
  //#endregion
131
131
  //#region src/lib/actions/clean.d.ts
132
132
  type CleanOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'dryRun' | 'namespace'>;
133
- declare const defaultCleanOptions: CleanOptions;
133
+ export declare const defaultCleanOptions: CleanOptions;
134
134
  type CleanResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'namespace'> & {
135
135
  deletedDecks: string[];
136
136
  deletedMedia: string[];
@@ -146,12 +146,12 @@ type CleanResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'namespac
146
146
  * @throws {Error} If Anki is unreachable or another error occurs during
147
147
  * deletion.
148
148
  */
149
- declare function cleanNotes(options?: PartialDeep<CleanOptions>): Promise<CleanResult>;
150
- declare function formatCleanResult(result: CleanResult, verbose?: boolean): string;
149
+ export declare function cleanNotes(options?: PartialDeep<CleanOptions>): Promise<CleanResult>;
150
+ export declare function formatCleanResult(result: CleanResult, verbose?: boolean): string;
151
151
  //#endregion
152
152
  //#region src/lib/actions/list.d.ts
153
153
  type ListOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'namespace'>;
154
- declare const defaultListOptions: ListOptions;
154
+ export declare const defaultListOptions: ListOptions;
155
155
  type ListResult = {
156
156
  duration: number;
157
157
  namespace: string;
@@ -160,8 +160,8 @@ type ListResult = {
160
160
  /**
161
161
  * Description List notes currently in Anki...
162
162
  */
163
- declare function listNotes(options?: PartialDeep<ListOptions>): Promise<ListResult>;
164
- declare function formatListResult(result: ListResult): string;
163
+ export declare function listNotes(options?: PartialDeep<ListOptions>): Promise<ListResult>;
164
+ export declare function formatListResult(result: ListResult): string;
165
165
  //#endregion
166
166
  //#region src/lib/actions/load-local-notes.d.ts
167
167
  type LoadOptions = Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'fetchAdapter' | 'fileAdapter' | 'namespace' | 'obsidianVault' | 'strictLineBreaks' | 'syncMediaAssets'>;
@@ -184,17 +184,17 @@ type RenameFilesResult = {
184
184
  notes: LocalNote[];
185
185
  };
186
186
  type RenameFilesOptions = Simplify<LoadOptions & RenameNotesOptions>;
187
- declare const defaultRenameFilesOptions: RenameFilesOptions;
187
+ export declare const defaultRenameFilesOptions: RenameFilesOptions;
188
188
  /**
189
189
  * Currently used for testing and by `yanki-obsidian`.
190
190
  */
191
- declare function renameFiles(allLocalFilePaths: string[], options: Partial<RenameFilesOptions>): Promise<RenameFilesResult>;
191
+ export declare function renameFiles(allLocalFilePaths: string[], options: Partial<RenameFilesOptions>): Promise<RenameFilesResult>;
192
192
  //#endregion
193
193
  //#region src/lib/actions/style.d.ts
194
194
  type SetStyleOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'dryRun'> & {
195
195
  css: string;
196
196
  };
197
- declare const defaultSetStyleOptions: SetStyleOptions;
197
+ export declare const defaultSetStyleOptions: SetStyleOptions;
198
198
  type SetStyleResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun'> & {
199
199
  duration: number;
200
200
  models: Array<{
@@ -203,10 +203,10 @@ type SetStyleResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun'> & {
203
203
  }>;
204
204
  }>;
205
205
  type GetStyleOptions = Pick<GlobalOptions, 'ankiConnectOptions'>;
206
- declare const defaultGetStyleOptions: GetStyleOptions;
207
- declare function getStyle(options: PartialDeep<GetStyleOptions>): Promise<string>;
208
- declare function setStyle(options?: PartialDeep<SetStyleOptions>): Promise<SetStyleResult>;
209
- declare function formatSetStyleResult(result: SetStyleResult, verbose?: boolean): string;
206
+ export declare const defaultGetStyleOptions: GetStyleOptions;
207
+ export declare function getStyle(options: PartialDeep<GetStyleOptions>): Promise<string>;
208
+ export declare function setStyle(options?: PartialDeep<SetStyleOptions>): Promise<SetStyleResult>;
209
+ export declare function formatSetStyleResult(result: SetStyleResult, verbose?: boolean): string;
210
210
  //#endregion
211
211
  //#region src/lib/actions/sync-notes.d.ts
212
212
  type SyncedNote = {
@@ -214,7 +214,7 @@ type SyncedNote = {
214
214
  note: YankiNote;
215
215
  };
216
216
  type SyncNotesOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'checkDatabase' | 'dryRun' | 'fileAdapter' | 'namespace' | 'strictMatching'>;
217
- declare const defaultSyncNotesOptions: SyncNotesOptions;
217
+ export declare const defaultSyncNotesOptions: SyncNotesOptions;
218
218
  type SyncNotesResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'namespace'> & {
219
219
  deletedDecks: string[];
220
220
  deletedMedia: string[];
@@ -232,11 +232,11 @@ type SyncNotesResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'name
232
232
  * about the sync
233
233
  * @throws {Error} For various reasons...
234
234
  */
235
- declare function syncNotes(allLocalNotes: YankiNote[], options?: PartialDeep<SyncNotesOptions>): Promise<SyncNotesResult>;
235
+ export declare function syncNotes(allLocalNotes: YankiNote[], options?: PartialDeep<SyncNotesOptions>): Promise<SyncNotesResult>;
236
236
  //#endregion
237
237
  //#region src/lib/actions/sync-files.d.ts
238
238
  type SyncFilesOptions = Simplify<Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'fetchAdapter' | 'fileAdapter' | 'manageFilenames' | 'maxFilenameLength' | 'obsidianVault' | 'strictLineBreaks' | 'syncMediaAssets'> & SyncNotesOptions>;
239
- declare const defaultSyncFilesOptions: SyncFilesOptions;
239
+ export declare const defaultSyncFilesOptions: SyncFilesOptions;
240
240
  type SyncedFile = Simplify<SyncedNote & {
241
241
  filePath: string | undefined;
242
242
  filePathOriginal: string | undefined;
@@ -258,8 +258,8 @@ type SyncFilesResult = Simplify<Omit<SyncNotesResult, 'synced'> & {
258
258
  * about the sync
259
259
  * @throws {Error} If syncing fails or file operations encounter an error.
260
260
  */
261
- declare function syncFiles(allLocalFilePaths: string[], options?: PartialDeep<SyncFilesOptions>): Promise<SyncFilesResult>;
262
- declare function formatSyncFilesResult(result: SyncFilesResult, verbose?: boolean): string;
261
+ export declare function syncFiles(allLocalFilePaths: string[], options?: PartialDeep<SyncFilesOptions>): Promise<SyncFilesResult>;
262
+ export declare function formatSyncFilesResult(result: SyncFilesResult, verbose?: boolean): string;
263
263
  //#endregion
264
264
  //#region src/lib/parse/parse.d.ts
265
265
  type GetNoteFromMarkdownOptions = Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'cwd' | 'fetchAdapter' | 'fileAdapter' | 'namespace' | 'obsidianVault' | 'resolveUrls' | 'strictLineBreaks' | 'syncMediaAssets'> & {
@@ -269,14 +269,14 @@ type GetNoteFromMarkdownOptions = Pick<GlobalOptions, 'allFilePaths' | 'basePath
269
269
  */
270
270
  namespaceValidationAndSanitization: boolean;
271
271
  };
272
- declare const defaultGetNoteFromMarkdownOptions: GetNoteFromMarkdownOptions;
273
- declare function getNoteFromMarkdown(markdown: string, options?: Partial<GetNoteFromMarkdownOptions>): Promise<YankiNote>;
272
+ export declare const defaultGetNoteFromMarkdownOptions: GetNoteFromMarkdownOptions;
273
+ export declare function getNoteFromMarkdown(markdown: string, options?: Partial<GetNoteFromMarkdownOptions>): Promise<YankiNote>;
274
274
  //#endregion
275
275
  //#region src/lib/utilities/url.d.ts
276
- declare function urlToHostAndPort(url: string): undefined | {
276
+ export declare function urlToHostAndPort(url: string): undefined | {
277
277
  host: string;
278
278
  port: number;
279
279
  };
280
- declare function hostAndPortToUrl(host: string, port: number): string;
280
+ export declare function hostAndPortToUrl(host: string, port: number): string;
281
281
  //#endregion
282
- export { type CleanOptions, type CleanResult, type FetchAdapter, type FileAdapter, type GetNoteFromMarkdownOptions, type GetStyleOptions, type ListOptions, type RenameFilesOptions, type RenameFilesResult, type SetStyleOptions, type SetStyleResult, type SyncFilesOptions, type SyncFilesResult, type SyncNotesOptions, type SyncNotesResult, type YankiNote, cleanNotes, defaultCleanOptions, defaultGetNoteFromMarkdownOptions, defaultGetStyleOptions, defaultListOptions, defaultRenameFilesOptions, defaultSetStyleOptions, defaultSyncFilesOptions, defaultSyncNotesOptions, formatCleanResult, formatListResult, formatSetStyleResult, formatSyncFilesResult, getNoteFromMarkdown, getStyle, hostAndPortToUrl, listNotes, renameFiles, setStyle, syncFiles, syncNotes, urlToHostAndPort };
282
+ export type { CleanOptions, CleanResult, FetchAdapter, FileAdapter, GetNoteFromMarkdownOptions, GetStyleOptions, ListOptions, RenameFilesOptions, RenameFilesResult, SetStyleOptions, SetStyleResult, SyncFilesOptions, SyncFilesResult, SyncNotesOptions, SyncNotesResult, YankiNote };
@@ -1,4 +1,4 @@
1
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/primitive.d.ts
1
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/primitive.d.ts
2
2
  /**
3
3
  Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
4
4
 
@@ -6,7 +6,7 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
6
6
  */
7
7
  type Primitive = null | undefined | string | number | boolean | symbol | bigint;
8
8
  //#endregion
9
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-any.d.ts
9
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/is-any.d.ts
10
10
  /**
11
11
  Returns a boolean for whether the given type is `any`.
12
12
 
@@ -37,7 +37,7 @@ const anyA = get(anyObject, 'a');
37
37
  */
38
38
  type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
39
39
  //#endregion
40
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-optional-key-of.d.ts
40
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/is-optional-key-of.d.ts
41
41
  /**
42
42
  Returns a boolean for whether the given key is an optional key of type.
43
43
 
@@ -80,7 +80,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
80
80
  */
81
81
  type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
82
82
  //#endregion
83
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/optional-keys-of.d.ts
83
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/optional-keys-of.d.ts
84
84
  /**
85
85
  Extract all optional keys from the given type.
86
86
 
@@ -118,7 +118,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
118
118
  ? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never; }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
119
119
  : never; // Should never happen
120
120
  //#endregion
121
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/required-keys-of.d.ts
121
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/required-keys-of.d.ts
122
122
  /**
123
123
  Extract all required keys from the given type.
124
124
 
@@ -152,7 +152,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
152
152
  type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
153
153
  ? Exclude<keyof Type, OptionalKeysOf<Type>> : never; // Should never happen
154
154
  //#endregion
155
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-never.d.ts
155
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/is-never.d.ts
156
156
  /**
157
157
  Returns a boolean for whether the given type is `never`.
158
158
 
@@ -208,7 +208,7 @@ type B = IsTrueFixed<never>;
208
208
  */
209
209
  type IsNever<T> = [T] extends [never] ? true : false;
210
210
  //#endregion
211
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/if.d.ts
211
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/if.d.ts
212
212
  /**
213
213
  An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
214
214
 
@@ -303,7 +303,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
303
303
  */
304
304
  type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
305
305
  //#endregion
306
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/internal/type.d.ts
306
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/internal/type.d.ts
307
307
  /**
308
308
  Matches any primitive, `void`, `Date`, or `RegExp` value.
309
309
  */
@@ -321,7 +321,7 @@ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T
321
321
  (...arguments_: infer B): unknown;
322
322
  } ? B extends A ? A extends B ? false : true : true : false;
323
323
  //#endregion
324
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/simplify.d.ts
324
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/simplify.d.ts
325
325
  /**
326
326
  Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
327
327
 
@@ -382,7 +382,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
382
382
  */
383
383
  type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
384
384
  //#endregion
385
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-equal.d.ts
385
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/is-equal.d.ts
386
386
  /**
387
387
  Returns a boolean for whether the two given types are equal.
388
388
 
@@ -413,7 +413,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
413
413
  // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
414
414
  type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
415
415
  //#endregion
416
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/omit-index-signature.d.ts
416
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/omit-index-signature.d.ts
417
417
  /**
418
418
  Omit any index signatures from the given object type, leaving only explicitly defined properties.
419
419
 
@@ -507,7 +507,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
507
507
  */
508
508
  type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType]; };
509
509
  //#endregion
510
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/pick-index-signature.d.ts
510
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/pick-index-signature.d.ts
511
511
  /**
512
512
  Pick only index signatures from the given object type, leaving out all explicitly defined properties.
513
513
 
@@ -555,7 +555,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
555
555
  */
556
556
  type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType]; };
557
557
  //#endregion
558
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/merge.d.ts
558
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/merge.d.ts
559
559
  // Merges two objects without worrying about index signatures.
560
560
  type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; } & Source>;
561
561
  /**
@@ -626,7 +626,7 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
626
626
  : never; // Should never happen
627
627
  type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
628
628
  //#endregion
629
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/internal/object.d.ts
629
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/internal/object.d.ts
630
630
  /**
631
631
  Merges user specified options with default options.
632
632
 
@@ -683,7 +683,7 @@ type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<
683
683
  ) ? Result : never;
684
684
  type _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Merge<Defaults, { [Key in keyof SpecifiedOptions as undefined extends Required<Options>[Key & keyof Options] ? Key : undefined extends SpecifiedOptions[Key] ? never : Key]: SpecifiedOptions[Key]; }>>>;
685
685
  //#endregion
686
- //#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/partial-deep.d.ts
686
+ //#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/partial-deep.d.ts
687
687
  /**
688
688
  @see {@link PartialDeep}
689
689
  */
@@ -805,7 +805,7 @@ Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for
805
805
  */
806
806
  type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = { [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options>; };
807
807
  //#endregion
808
- //#region node_modules/.pnpm/yanki-connect@4.0.10/node_modules/yanki-connect/dist/index.d.ts
808
+ //#region node_modules/.pnpm/yanki-connect@4.0.11/node_modules/yanki-connect/dist/index.d.ts
809
809
  //#region src/types/deck.d.ts
810
810
  type DeckStats = {
811
811
  deck_id: number;
@@ -1551,7 +1551,7 @@ type GlobalOptions = {
1551
1551
  //#endregion
1552
1552
  //#region src/lib/actions/clean.d.ts
1553
1553
  type CleanOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'dryRun' | 'namespace'>;
1554
- declare const defaultCleanOptions: CleanOptions;
1554
+ export declare const defaultCleanOptions: CleanOptions;
1555
1555
  type CleanResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'namespace'> & {
1556
1556
  deletedDecks: string[];
1557
1557
  deletedMedia: string[];
@@ -1567,12 +1567,12 @@ type CleanResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'namespac
1567
1567
  * @throws {Error} If Anki is unreachable or another error occurs during
1568
1568
  * deletion.
1569
1569
  */
1570
- declare function cleanNotes(options?: PartialDeep<CleanOptions>): Promise<CleanResult>;
1571
- declare function formatCleanResult(result: CleanResult, verbose?: boolean): string;
1570
+ export declare function cleanNotes(options?: PartialDeep<CleanOptions>): Promise<CleanResult>;
1571
+ export declare function formatCleanResult(result: CleanResult, verbose?: boolean): string;
1572
1572
  //#endregion
1573
1573
  //#region src/lib/actions/list.d.ts
1574
1574
  type ListOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'namespace'>;
1575
- declare const defaultListOptions: ListOptions;
1575
+ export declare const defaultListOptions: ListOptions;
1576
1576
  type ListResult = {
1577
1577
  duration: number;
1578
1578
  namespace: string;
@@ -1581,8 +1581,8 @@ type ListResult = {
1581
1581
  /**
1582
1582
  * Description List notes currently in Anki...
1583
1583
  */
1584
- declare function listNotes(options?: PartialDeep<ListOptions>): Promise<ListResult>;
1585
- declare function formatListResult(result: ListResult): string;
1584
+ export declare function listNotes(options?: PartialDeep<ListOptions>): Promise<ListResult>;
1585
+ export declare function formatListResult(result: ListResult): string;
1586
1586
  //#endregion
1587
1587
  //#region src/lib/actions/load-local-notes.d.ts
1588
1588
  type LoadOptions = Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'fetchAdapter' | 'fileAdapter' | 'namespace' | 'obsidianVault' | 'strictLineBreaks' | 'syncMediaAssets'>;
@@ -1605,17 +1605,17 @@ type RenameFilesResult = {
1605
1605
  notes: LocalNote[];
1606
1606
  };
1607
1607
  type RenameFilesOptions = Simplify<LoadOptions & RenameNotesOptions>;
1608
- declare const defaultRenameFilesOptions: RenameFilesOptions;
1608
+ export declare const defaultRenameFilesOptions: RenameFilesOptions;
1609
1609
  /**
1610
1610
  * Currently used for testing and by `yanki-obsidian`.
1611
1611
  */
1612
- declare function renameFiles(allLocalFilePaths: string[], options: Partial<RenameFilesOptions>): Promise<RenameFilesResult>;
1612
+ export declare function renameFiles(allLocalFilePaths: string[], options: Partial<RenameFilesOptions>): Promise<RenameFilesResult>;
1613
1613
  //#endregion
1614
1614
  //#region src/lib/actions/style.d.ts
1615
1615
  type SetStyleOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'dryRun'> & {
1616
1616
  css: string;
1617
1617
  };
1618
- declare const defaultSetStyleOptions: SetStyleOptions;
1618
+ export declare const defaultSetStyleOptions: SetStyleOptions;
1619
1619
  type SetStyleResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun'> & {
1620
1620
  duration: number;
1621
1621
  models: Array<{
@@ -1624,10 +1624,10 @@ type SetStyleResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun'> & {
1624
1624
  }>;
1625
1625
  }>;
1626
1626
  type GetStyleOptions = Pick<GlobalOptions, 'ankiConnectOptions'>;
1627
- declare const defaultGetStyleOptions: GetStyleOptions;
1628
- declare function getStyle(options: PartialDeep<GetStyleOptions>): Promise<string>;
1629
- declare function setStyle(options?: PartialDeep<SetStyleOptions>): Promise<SetStyleResult>;
1630
- declare function formatSetStyleResult(result: SetStyleResult, verbose?: boolean): string;
1627
+ export declare const defaultGetStyleOptions: GetStyleOptions;
1628
+ export declare function getStyle(options: PartialDeep<GetStyleOptions>): Promise<string>;
1629
+ export declare function setStyle(options?: PartialDeep<SetStyleOptions>): Promise<SetStyleResult>;
1630
+ export declare function formatSetStyleResult(result: SetStyleResult, verbose?: boolean): string;
1631
1631
  //#endregion
1632
1632
  //#region src/lib/actions/sync-notes.d.ts
1633
1633
  type SyncedNote = {
@@ -1635,7 +1635,7 @@ type SyncedNote = {
1635
1635
  note: YankiNote;
1636
1636
  };
1637
1637
  type SyncNotesOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'checkDatabase' | 'dryRun' | 'fileAdapter' | 'namespace' | 'strictMatching'>;
1638
- declare const defaultSyncNotesOptions: SyncNotesOptions;
1638
+ export declare const defaultSyncNotesOptions: SyncNotesOptions;
1639
1639
  type SyncNotesResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'namespace'> & {
1640
1640
  deletedDecks: string[];
1641
1641
  deletedMedia: string[];
@@ -1653,11 +1653,11 @@ type SyncNotesResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'name
1653
1653
  * about the sync
1654
1654
  * @throws {Error} For various reasons...
1655
1655
  */
1656
- declare function syncNotes(allLocalNotes: YankiNote[], options?: PartialDeep<SyncNotesOptions>): Promise<SyncNotesResult>;
1656
+ export declare function syncNotes(allLocalNotes: YankiNote[], options?: PartialDeep<SyncNotesOptions>): Promise<SyncNotesResult>;
1657
1657
  //#endregion
1658
1658
  //#region src/lib/actions/sync-files.d.ts
1659
1659
  type SyncFilesOptions = Simplify<Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'fetchAdapter' | 'fileAdapter' | 'manageFilenames' | 'maxFilenameLength' | 'obsidianVault' | 'strictLineBreaks' | 'syncMediaAssets'> & SyncNotesOptions>;
1660
- declare const defaultSyncFilesOptions: SyncFilesOptions;
1660
+ export declare const defaultSyncFilesOptions: SyncFilesOptions;
1661
1661
  type SyncedFile = Simplify<SyncedNote & {
1662
1662
  filePath: string | undefined;
1663
1663
  filePathOriginal: string | undefined;
@@ -1679,8 +1679,8 @@ type SyncFilesResult = Simplify<Omit<SyncNotesResult, 'synced'> & {
1679
1679
  * about the sync
1680
1680
  * @throws {Error} If syncing fails or file operations encounter an error.
1681
1681
  */
1682
- declare function syncFiles(allLocalFilePaths: string[], options?: PartialDeep<SyncFilesOptions>): Promise<SyncFilesResult>;
1683
- declare function formatSyncFilesResult(result: SyncFilesResult, verbose?: boolean): string;
1682
+ export declare function syncFiles(allLocalFilePaths: string[], options?: PartialDeep<SyncFilesOptions>): Promise<SyncFilesResult>;
1683
+ export declare function formatSyncFilesResult(result: SyncFilesResult, verbose?: boolean): string;
1684
1684
  //#endregion
1685
1685
  //#region src/lib/parse/parse.d.ts
1686
1686
  type GetNoteFromMarkdownOptions = Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'cwd' | 'fetchAdapter' | 'fileAdapter' | 'namespace' | 'obsidianVault' | 'resolveUrls' | 'strictLineBreaks' | 'syncMediaAssets'> & {
@@ -1690,14 +1690,14 @@ type GetNoteFromMarkdownOptions = Pick<GlobalOptions, 'allFilePaths' | 'basePath
1690
1690
  */
1691
1691
  namespaceValidationAndSanitization: boolean;
1692
1692
  };
1693
- declare const defaultGetNoteFromMarkdownOptions: GetNoteFromMarkdownOptions;
1694
- declare function getNoteFromMarkdown(markdown: string, options?: Partial<GetNoteFromMarkdownOptions>): Promise<YankiNote>;
1693
+ export declare const defaultGetNoteFromMarkdownOptions: GetNoteFromMarkdownOptions;
1694
+ export declare function getNoteFromMarkdown(markdown: string, options?: Partial<GetNoteFromMarkdownOptions>): Promise<YankiNote>;
1695
1695
  //#endregion
1696
1696
  //#region src/lib/utilities/url.d.ts
1697
- declare function urlToHostAndPort(url: string): undefined | {
1697
+ export declare function urlToHostAndPort(url: string): undefined | {
1698
1698
  host: string;
1699
1699
  port: number;
1700
1700
  };
1701
- declare function hostAndPortToUrl(host: string, port: number): string;
1701
+ export declare function hostAndPortToUrl(host: string, port: number): string;
1702
1702
  //#endregion
1703
- export { type CleanOptions, type CleanResult, type FetchAdapter, type FileAdapter, type GetNoteFromMarkdownOptions, type GetStyleOptions, type ListOptions, type RenameFilesOptions, type RenameFilesResult, type SetStyleOptions, type SetStyleResult, type SyncFilesOptions, type SyncFilesResult, type SyncNotesOptions, type SyncNotesResult, type YankiNote, cleanNotes, defaultCleanOptions, defaultGetNoteFromMarkdownOptions, defaultGetStyleOptions, defaultListOptions, defaultRenameFilesOptions, defaultSetStyleOptions, defaultSyncFilesOptions, defaultSyncNotesOptions, formatCleanResult, formatListResult, formatSetStyleResult, formatSyncFilesResult, getNoteFromMarkdown, getStyle, hostAndPortToUrl, listNotes, renameFiles, setStyle, syncFiles, syncNotes, urlToHostAndPort };
1703
+ export type { CleanOptions, CleanResult, FetchAdapter, FileAdapter, GetNoteFromMarkdownOptions, GetStyleOptions, ListOptions, RenameFilesOptions, RenameFilesResult, SetStyleOptions, SetStyleResult, SyncFilesOptions, SyncFilesResult, SyncNotesOptions, SyncNotesResult, YankiNote };