createOverlayStore
createOverlayStore() returns an OverlayStoreApi with open, close, closeAll, reject, remove, clear, subscribe, getSnapshot, and getInitialSnapshot. Internally it stores OverlayState in @ilokesto/store and keeps pending promise settlers by overlay id.
const store = createOverlayStore();
const request = store.open<boolean>({ type: 'confirm', props: { title: 'Delete?' } });
store.close(request.id, true);
store.remove(request.id);
const result = await request.promise;open creates an OverlayItem and returns { id, promise }; an active explicit id is deduplicated to the existing request. close marks one open item closing and records closeResult. closeAll marks every open item closing without settling it. reject records rejection and settles by rejection when removal occurs. remove removes a specific item, or the latest item when no id is passed, and settles its promise. clear settles and removes every item. Use the store directly in tests or advanced shells; use useOverlay in normal React components.
Practical note
The reference pages describe the runtime contract exactly. Guides may wrap these APIs into product-specific helpers, but those helpers should keep the same lifecycle language: open creates an item, close starts a closing state, remove settles and deletes an item, and clear ends every pending overlay in the provider scope.