File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
core/src/fields/inputFields/fields/ImageListSuggester Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 5959 onclick : () => {
6060 const imagePath = value [index ];
6161
62+ // in this case, using `.then()` is nicer than `await` and a try-catch block
6263 navigator .clipboard
6364 .writeText (imagePath )
6465 .then (() => {
6566 props .plugin .internal .showNotice (' Image path copied to clipboard' );
6667 })
6768 .catch (() => {
68- props .plugin .internal .showNotice (' Failed to copy image to clipboard' );
69+ props .plugin .internal .showNotice (' Failed to copy image path to clipboard' );
6970 });
7071 },
7172 });
Original file line number Diff line number Diff line change 11import type { API as JsEngineAPI } from 'jsEngine/api/API' ;
2+ import type JsEnginePlugin from 'jsEngine/main' ;
3+ import type { Plugin } from 'obsidian' ;
24import type { DataviewApi } from 'obsidian-dataview' ;
35import type { Templater , TemplaterPlugin } from 'packages/obsidian/extraTypes/Templater' ;
46import type MetaBindPlugin from 'packages/obsidian/src/main' ;
57
68export function getDataViewPluginAPI ( plugin : MetaBindPlugin ) : DataviewApi {
79 /* eslint-disable */
810 const dataViewPlugin = plugin . dependencyManager . checkDependency ( 'dataview' ) ;
9- return ( dataViewPlugin as any ) . api as DataviewApi ;
11+ return ( dataViewPlugin as Plugin & { api : DataviewApi } ) . api ;
1012}
1113
1214export function getJsEnginePluginAPI ( plugin : MetaBindPlugin ) : JsEngineAPI {
1315 /* eslint-disable */
1416 const jsEnginePlugin = plugin . dependencyManager . checkDependency ( 'js-engine' ) ;
15- return ( jsEnginePlugin as any ) . api as JsEngineAPI ;
17+ return ( jsEnginePlugin as JsEnginePlugin ) . api ;
1618}
1719
1820export enum Templater_RunMode {
You can’t perform that action at this time.
0 commit comments