update more typescript errors for vercel
This commit is contained in:
parent
8d5b41f530
commit
3c72aecb80
|
|
@ -119,7 +119,7 @@ export function applyAutomergePatchesToTLStore(
|
|||
|
||||
// Create new object with correct typeName if it changed
|
||||
if (correctTypeName !== record.typeName) {
|
||||
record = { ...record, typeName: correctTypeName }
|
||||
record = { ...record, typeName: correctTypeName } as TLRecord
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -157,6 +157,7 @@ export class CloudflareNetworkAdapter extends NetworkAdapter {
|
|||
private workerUrl: string
|
||||
private websocket: WebSocket | null = null
|
||||
private roomId: string | null = null
|
||||
private peerId: PeerId | null = null
|
||||
private readyPromise: Promise<void>
|
||||
private readyResolve: (() => void) | null = null
|
||||
private keepAliveInterval: NodeJS.Timeout | null = null
|
||||
|
|
@ -189,6 +190,9 @@ export class CloudflareNetworkAdapter extends NetworkAdapter {
|
|||
return
|
||||
}
|
||||
|
||||
// Store peerId
|
||||
this.peerId = peerId
|
||||
|
||||
// Clean up existing connection
|
||||
this.cleanup()
|
||||
|
||||
|
|
@ -223,16 +227,20 @@ export class CloudflareNetworkAdapter extends NetworkAdapter {
|
|||
// Automerge Repo expects binary sync messages as Uint8Array
|
||||
this.emit('message', {
|
||||
type: 'sync',
|
||||
data: new Uint8Array(event.data)
|
||||
})
|
||||
data: new Uint8Array(event.data),
|
||||
senderId: this.peerId || 'unknown' as PeerId,
|
||||
targetId: this.peerId || 'unknown' as PeerId
|
||||
} as Message)
|
||||
} else if (event.data instanceof Blob) {
|
||||
// Handle Blob messages (convert to Uint8Array)
|
||||
event.data.arrayBuffer().then((buffer) => {
|
||||
console.log('🔌 CloudflareAdapter: Received Blob message, converted to Uint8Array')
|
||||
this.emit('message', {
|
||||
type: 'sync',
|
||||
data: new Uint8Array(buffer)
|
||||
})
|
||||
data: new Uint8Array(buffer),
|
||||
senderId: this.peerId || 'unknown' as PeerId,
|
||||
targetId: this.peerId || 'unknown' as PeerId
|
||||
} as Message)
|
||||
})
|
||||
} else {
|
||||
// Handle text messages (our custom protocol for backward compatibility)
|
||||
|
|
|
|||
|
|
@ -140,10 +140,18 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus
|
|||
// Get the store with status
|
||||
const storeWithStatus = useMemo((): TLStoreWithStatus => {
|
||||
if (!store) {
|
||||
return {
|
||||
status: isLoading ? 'loading' : 'not-synced',
|
||||
connectionStatus: 'offline',
|
||||
store: undefined
|
||||
if (isLoading) {
|
||||
return {
|
||||
status: 'loading' as const,
|
||||
connectionStatus: 'offline' as const,
|
||||
store: undefined
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
status: 'not-synced' as const,
|
||||
connectionStatus: 'offline' as const,
|
||||
store: undefined
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +166,7 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus
|
|||
const presence = useAutomergePresence({
|
||||
handle: handle || null,
|
||||
store: store || null,
|
||||
userMetadata: user || { userId: 'anonymous', name: 'Anonymous', color: '#000000' }
|
||||
userMetadata: user && 'userId' in user ? user : { userId: user?.id || 'anonymous', name: user?.name || 'Anonymous', color: '#000000' }
|
||||
})
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ export const useWebSpeechTranscription = ({
|
|||
const speakerChangeThreshold = 0.3 // Threshold for detecting speaker changes
|
||||
|
||||
// Function to add line breaks after pauses and improve punctuation
|
||||
const processTranscript = useCallback((text: string, isFinal: boolean = false, confidence?: number) => {
|
||||
const processTranscript = useCallback((text: string, isFinal: boolean = false, _confidence?: number) => {
|
||||
if (!text.trim()) return text
|
||||
|
||||
let processedText = text.trim()
|
||||
|
|
|
|||
|
|
@ -185,14 +185,14 @@ export class HoloSphereService {
|
|||
})
|
||||
// Handle Promise if subscribe returns one
|
||||
if (subscribeResult instanceof Promise) {
|
||||
subscribeResult.then((result) => {
|
||||
subscribeResult.then((result: any) => {
|
||||
unsubscribe = result?.unsubscribe || undefined
|
||||
console.log(`✅ Subscribe called successfully for ${lens}`)
|
||||
}).catch((err) => {
|
||||
console.error(`❌ Error in subscribe promise for ${lens}:`, err)
|
||||
})
|
||||
} else {
|
||||
unsubscribe = subscribeResult?.unsubscribe || undefined
|
||||
unsubscribe = (subscribeResult as any)?.unsubscribe || undefined
|
||||
console.log(`✅ Subscribe called successfully for ${lens}`)
|
||||
}
|
||||
} catch (subError) {
|
||||
|
|
|
|||
|
|
@ -201,18 +201,6 @@ export class FathomTranscriptShape extends BaseBoxShapeUtil<IFathomTranscript> {
|
|||
gap: '12px',
|
||||
}
|
||||
|
||||
const buttonStyle: React.CSSProperties = {
|
||||
padding: '4px 8px',
|
||||
fontSize: '10px',
|
||||
border: '1px solid #ccc',
|
||||
borderRadius: '4px',
|
||||
backgroundColor: 'white',
|
||||
cursor: 'pointer',
|
||||
zIndex: 1000,
|
||||
position: 'relative',
|
||||
pointerEvents: 'auto',
|
||||
}
|
||||
|
||||
const transcriptEntryStyle: React.CSSProperties = {
|
||||
marginBottom: '8px',
|
||||
padding: '8px',
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export function resolveOverlaps(editor: Editor, shapeId: string): void {
|
|||
'Embed', 'Slide', 'Markdown', 'SharedPiano', 'MycrozineTemplate', 'ChatBox'
|
||||
]
|
||||
|
||||
const shape = editor.getShape(shapeId)
|
||||
const shape = editor.getShape(shapeId as TLShapeId)
|
||||
if (!shape || !customShapeTypes.includes(shape.type)) return
|
||||
|
||||
const shapeBounds = getShapeBounds(editor, shape)
|
||||
|
|
|
|||
Loading…
Reference in New Issue