File tree Expand file tree Collapse file tree 5 files changed +29
-22
lines changed Expand file tree Collapse file tree 5 files changed +29
-22
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ import { Drawer } from '@material/mwc-drawer';
15
15
import { ActionDetail , List } from '@material/mwc-list' ;
16
16
import { ListItem } from '@material/mwc-list/mwc-list-item' ;
17
17
18
- import { Mixin , newPendingStateEvent , UserInfoEvent } from './foundation.js' ;
18
+ import { Mixin , newPendingStateEvent } from './foundation.js' ;
19
+ import { UserInfoEvent } from './compas/foundation.js' ;
19
20
import { LoggingElement } from './Logging.js' ;
20
21
import { PluggingElement , Plugin , pluginIcons } from './Plugging.js' ;
21
22
import { SettingElement } from './Setting.js' ;
Original file line number Diff line number Diff line change 1
- import { newUserInfoEvent } from '.. /foundation.js' ;
1
+ import { newUserInfoEvent } from './foundation.js' ;
2
2
3
3
import { CompasUserInfoService } from '../compas-services/CompasUserInfoService.js' ;
4
4
import { createLogEvent } from '../compas-services/foundation.js' ;
Original file line number Diff line number Diff line change @@ -106,3 +106,25 @@ export function compareVersions(
106
106
}
107
107
return result ;
108
108
}
109
+
110
+ /** Represents user information from a backend. */
111
+ export interface UserInfoDetail {
112
+ name : string ;
113
+ }
114
+ export type UserInfoEvent = CustomEvent < UserInfoDetail > ;
115
+ export function newUserInfoEvent (
116
+ name : string ,
117
+ eventInitDict ?: CustomEventInit < Partial < UserInfoDetail > >
118
+ ) : UserInfoEvent {
119
+ return new CustomEvent < UserInfoDetail > ( 'userinfo' , {
120
+ bubbles : true ,
121
+ composed : true ,
122
+ ...eventInitDict ,
123
+ detail : { name, ...eventInitDict ?. detail } ,
124
+ } ) ;
125
+ }
126
+ declare global {
127
+ interface ElementEventMap {
128
+ [ 'userinfo' ] : UserInfoEvent ;
129
+ }
130
+ }
Original file line number Diff line number Diff line change @@ -479,23 +479,6 @@ export function newOpenDocEvent(
479
479
} ) ;
480
480
}
481
481
482
- /** Represents user information from a backend. */
483
- export interface UserInfoDetail {
484
- name : string ;
485
- }
486
- export type UserInfoEvent = CustomEvent < UserInfoDetail > ;
487
- export function newUserInfoEvent (
488
- name : string ,
489
- eventInitDict ?: CustomEventInit < Partial < UserInfoDetail > >
490
- ) : UserInfoEvent {
491
- return new CustomEvent < UserInfoDetail > ( 'userinfo' , {
492
- bubbles : true ,
493
- composed : true ,
494
- ...eventInitDict ,
495
- detail : { name, ...eventInitDict ?. detail } ,
496
- } ) ;
497
- }
498
-
499
482
/** @returns a reference to `element` with segments delimited by '/'. */
500
483
// TODO(c-dinkel): replace with identity (FIXME)
501
484
export function referencePath ( element : Element ) : string {
@@ -2880,7 +2863,6 @@ declare global {
2880
2863
[ 'pending-state' ] : PendingStateEvent ;
2881
2864
[ 'editor-action' ] : EditorActionEvent < EditorAction > ;
2882
2865
[ 'open-doc' ] : OpenDocEvent ;
2883
- [ 'userinfo' ] : UserInfoEvent ;
2884
2866
[ 'wizard' ] : WizardEvent ;
2885
2867
[ 'validate' ] : ValidateEvent ;
2886
2868
[ 'log' ] : LogEvent ;
Original file line number Diff line number Diff line change 1
1
import { expect , fixture , html } from '@open-wc/testing' ;
2
2
3
- import { updateDocumentInOpenSCD } from '../../../src/compas/foundation.js' ;
3
+ import {
4
+ updateDocumentInOpenSCD ,
5
+ newUserInfoEvent ,
6
+ } from '../../../src/compas/foundation.js' ;
4
7
5
8
import { OpenSCD } from '../../../src/open-scd.js' ;
6
9
import '../../../src/open-scd.js' ;
7
- import { newUserInfoEvent } from '../../../src/foundation.js' ;
8
10
9
11
describe ( 'compas-foundation' , ( ) => {
10
12
let element : OpenSCD ;
You can’t perform that action at this time.
0 commit comments