@iso-safety-signs/core
Installation
Section titled “Installation”npm install @iso-safety-signs/coreAPI reference
Section titled “API reference”| Function | Returns | Description |
|---|---|---|
getAllSigns() | Sign[] | Returns every sign in the library. |
getSign(id) | Sign | Returns a single sign by its ID. Throws if not found. |
getSignsByCategory(category) | Sign[] | Returns all signs belonging to the given category. |
import { getAllSigns, getSign, getSignsByCategory } from '@iso-safety-signs/core';
// All signsconst signs = getAllSigns();
// Single sign by IDconst exit = getSign('e001-emergency-exit');
// All emergency signsconst emergencySigns = getSignsByCategory('emergency');TypeScript types
Section titled “TypeScript types”type SignCategory = | 'emergency' | 'fire' | 'mandatory' | 'prohibition' | 'warning';
type SignAssets = { svg: string; png: Record<240 | 512 | 768 | 1024 | 2048, string>; webp: Record<240 | 512 | 768 | 1024 | 2048, string>;};
type Sign = { id: string; // e.g. 'e001-emergency-exit' code: string; // e.g. 'E001' name: string; // e.g. 'Emergency exit' description: string; // Plain-language description of the sign category: SignCategory; svg: string; // Inline SVG markup assets: SignAssets;};Category values
Section titled “Category values”| Value | Description |
|---|---|
emergency | Emergency escape, first aid, and evacuation signs |
fire | Fire-fighting equipment signs |
mandatory | Signs requiring specific behaviour or PPE |
prohibition | Signs forbidding an action |
warning | Hazard and caution signs |
ID format
Section titled “ID format”Sign IDs follow the pattern {code-lowercase}-{kebab-name}, e.g.:
e001-emergency-exitp001-no-smokingm001-wear-eye-protectionw001-flammable-materialf001-fire-extinguisher