Initial commit
This commit is contained in:
17
src/lib/session-attachment-events.ts
Normal file
17
src/lib/session-attachment-events.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export const ATTACH_FILE_TO_SESSION_EVENT = "codeg:attach-file-to-session"
|
||||
|
||||
export interface AttachFileToSessionDetail {
|
||||
tabId: string
|
||||
path: string
|
||||
}
|
||||
|
||||
export function emitAttachFileToSession(
|
||||
detail: AttachFileToSessionDetail
|
||||
): void {
|
||||
if (typeof window === "undefined") return
|
||||
window.dispatchEvent(
|
||||
new CustomEvent<AttachFileToSessionDetail>(ATTACH_FILE_TO_SESSION_EVENT, {
|
||||
detail,
|
||||
})
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user