File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
packages/svelte/src/toolbar Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -10,15 +10,16 @@ const config = {
1010 * @param {Partial<import('./public.d.ts').Config> } options
1111 */
1212export function configure ( options ) {
13- for ( const [ key , value ] of options ) {
13+ for ( const [ key , value ] of Object . entries ( options ) ) {
1414 if ( key === 'tools' ) {
1515 for ( let tool of /** @type {import('./public.d.ts').Config.tools[0][] }*/ value ) {
1616 if ( typeof tool === 'function' ) {
17- tool = tool ( ) ;
17+ tool = tool ( ) ; // TODO lazy init?
1818 }
19+ /** @type {import('./public.d.ts').Tool }*/
1920 const existing = config . tools . find ( ( t ) => t . name === tool . name ) ;
2021 if ( existing ) {
21- for ( const [ k , v ] of tool ) {
22+ for ( const [ k , v ] of Object . entries ( tool ) ) {
2223 existing [ k ] = v ;
2324 }
2425 } else {
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ export * from './index.js';
33export interface Tool {
44 name : string ;
55 icon : string ; // url or svg
6- activate ( ) ;
7- deactivate ( ) ;
6+ activate : ( ) => void ;
7+ deactivate : ( ) => void ;
88 keyCombo ?: string ;
99 disabled ?: boolean ;
1010}
You can’t perform that action at this time.
0 commit comments