{"id":25621,"library":"geostyler-style","title":"GeoStyler Style","description":"A TypeScript declaration file and utility library defining the geostyler-style format, an exchange format for representing geographic styles that can be translated between SLD, OpenLayers, Mapbox, CartoCSS and other standards. Current stable version is 12.0.0, released April 2026. The package ships TypeScript types and includes type guards for runtime type checking. It is developed as part of GeoStyler project, which provides UI components for building styles. Key differentiator: designed as an interchange format rather than a new styling standard, capable of capturing capabilities of multiple style formats while remaining human-readable.","status":"active","version":"12.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/geostyler/geostyler-style","tags":["javascript","typescript"],"install":[{"cmd":"npm install geostyler-style","lang":"bash","label":"npm"},{"cmd":"yarn add geostyler-style","lang":"bash","label":"yarn"},{"cmd":"pnpm add geostyler-style","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Styler is a named export, not default. Use named import.","wrong":"import Styler from 'geostyler-style'","symbol":"Styler","correct":"import { Styler } from 'geostyler-style'"},{"note":"Package is ESM-only since v11. CJS require will fail.","wrong":"const { Symbolizer } = require('geostyler-style')","symbol":"Symbolizer","correct":"import { Symbolizer } from 'geostyler-style'"},{"note":"Since v12.0.0, typeguards are re-exported from main entry; using dist/ path works but is unofficial.","wrong":"import { isFilter } from 'geostyler-style/dist/typeguards'","symbol":"isFilter","correct":"import { isFilter } from 'geostyler-style'"}],"quickstart":{"code":"import { Styler, Style, Rule, Symbolizer, Expression, isSymbolizer } from 'geostyler-style'\n\nconst pointStyle: Style = {\n  name: 'My Point Style',\n  rules: [{\n    name: 'Rule 1',\n    symbolizers: [{\n      kind: 'Mark',\n      wellKnownName: 'Circle',\n      color: '#FF0000',\n      radius: 6\n    }]\n  }]\n}\n\n// Use type guard to check symbolizer kind\nif (pointStyle.rules[0].symbolizers[0].kind === 'Mark') {\n  console.log(isSymbolizer(pointStyle.rules[0].symbolizers[0])); // true\n}","lang":"typescript","description":"Creates a minimal GeoStyler style with a point mark symbolizer and uses the isSymbolizer type guard."},"warnings":[{"fix":"If you define custom functions, ensure they conform to the updated GeoStylerUnknownFunction type. For expressions using 'geometry', update type annotations accordingly.","message":"Expression type extended to support 'geometry' parameter; GeoStylerUnknownFunction extended with Fcustom functions.","severity":"breaking","affected_versions":">=12.0.0"},{"fix":"Use direct imports like 'geostyler-style' instead of 'geostyler-style/dist/...'. If you had imports referencing dist/ for v10.2.0–10.5.0, remove the dist/ path segment.","message":"Package structure changed in v10.2.0 and reverted in v11.0.0; imports from dist/ paths may break.","severity":"breaking","affected_versions":">=10.2.0 <11.0.0"},{"fix":"Switch from require() to import statements. If you must use CJS, use dynamic import(): const { Styler } = await import('geostyler-style')","message":"Package now ESM-only; CJS require will throw error.","severity":"breaking","affected_versions":">=11.0.0"},{"fix":"Change import to 'geostyler-style' directly. For example: import { isFilter } from 'geostyler-style'","message":"Importing from 'geostyler-style/dist/typeguards' is deprecated; re-exports from main entry exist since v12.0.0.","severity":"deprecated","affected_versions":">=12.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run npm install geostyler-style@12.0.0. Ensure tsconfig.json includes \"node\" in compilerOptions.types or \"esModuleInterop\": true.","cause":"Missing installation or missing TypeScript types.","error":"Cannot find module 'geostyler-style' or its corresponding type declarations."},{"fix":"Change import to 'geostyler-style' (typeguards are re-exported in v12+).","cause":"Importing from internal dist/ path which may have moved.","error":"Module not found: Can't resolve 'geostyler-style/dist/typeguards'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}