interface Page { title: string; content: string; lang: T; } function getPage ( title: string, content: string, lang: T, ): Page { return { title, content, lang, } } class AppPage { constructor ( private title: string, private content: string, private lang: T, ) {} public get page () { return getPage( this.title, this.content, this.lang, ) } } enum lang { ru = 'ru', en = 'en', } const appPage = new AppPage( 'App', 'Hello, World!', lang.en as const, ) appPage.page // WebStrom AppPage.page(): Page // VSCode AppPage.page: Page