Create class and define static constants there.
export class Settings {
static something: 'someone';
static apiUrl = '/api';
static defaultPageSize = 5;
}
Can be used anywhere in the application.
url = Settings.apiUrl;
Confirmed to work with TS ver 5.5. Type safety. No javascript hackery needed.