(id: string)
| 149 | } |
| 150 | |
| 151 | export function removeUserFrame(id: string): boolean { |
| 152 | if (DEFAULT_FRAMES_BY_ID[id]) { |
| 153 | throw new Error(`Cannot remove built-in frame "${id}".`); |
| 154 | } |
| 155 | const frames = loadUserFrames(); |
| 156 | const before = frames.length; |
| 157 | const next = frames.filter((f) => f.id !== id); |
| 158 | if (next.length === before) return false; |
| 159 | saveUserFrames(next); |
| 160 | return true; |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Read a Frame from a JSON file on disk and add it to the user registry. |
no test coverage detected