Files

24 lines
1.4 KiB
JavaScript

const fs = require('fs')
const p = 'C:/Users/ASUS/Documents/deepseek-harness/default-workspace/desktop-pet/src/preload/index.ts'
let c = fs.readFileSync(p, 'utf8')
function rep(from, to) {
if (!c.includes(from)) {
console.log('MISS ::', from.slice(0, 60).replace(/\n/g, '\\n'))
return
}
c = c.replace(from, to)
}
rep(
" getProfiles: () => Promise<Array<{ id: string; active: boolean; level: string }>>\n delProfile: (id: string) => Promise<Array<{ id: string; active: boolean; level: string }>>",
" getProfiles: () => Promise<Array<{ id: string; name: string; active: boolean; level: string }>>\n delProfile: (id: string) => Promise<Array<{ id: string; name: string; active: boolean; level: string }>>"
)
rep(
" createProfile: (name: string) => Promise<Array<{ id: string; active: boolean }>>\n switchProfile: (id: string) => Promise<Array<{ id: string; active: boolean }>>",
" createProfile: (name: string, skinId: string) => Promise<Array<{ id: string; name: string; active: boolean; level: string }>>\n renameProfile: (id: string, name: string) => Promise<Array<{ id: string; name: string; active: boolean; level: string }>>\n switchProfile: (id: string) => Promise<Array<{ id: string; name: string; active: boolean; level: string }>>\n renameSkin: (id: string, name: string) => Promise<Array<{ id: string; name: string; active: boolean }>>"
)
fs.writeFileSync(p, c, 'utf8')
console.log('preload types fixed')