TypeScript

declare global

Në shqip përdoret i njëjti emër.

ShpjegimiSQ

Me declare global i shton tipe objekteve globale — p.sh. një fushë që e vendos vetë te window. Pa këtë, TypeScript-i ankohet që window.konfig s'ekziston.

EnglishEN

With declare global you add types to global objects — e.g. a field you set yourself on window. Without it, TypeScript complains that window.config doesn't exist.

Si ta mendosh

Si ta shtosh emrin tënd në tabelën e njoftimeve të shkollës, që ta njohin të gjithë.

Lexoje në anglisht

Like adding your name to the school noticeboard so everyone knows it.

Shembull koditypescript

declare global {
  interface Window { fjaloriVersioni: string }
}
window.fjaloriVersioni = "1.0";

Terma të lidhur