Skip to content

Instantly share code, notes, and snippets.

@frontdevops
Created July 27, 2016 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frontdevops/4e8a91497f3dddf9bd7a75d4c08d7ed1 to your computer and use it in GitHub Desktop.
Save frontdevops/4e8a91497f3dddf9bd7a75d4c08d7ed1 to your computer and use it in GitHub Desktop.
// Где-то в декларации прописано так:
declare var require: <T>(s :string) => T;
// Есть интерфейсы
interface ICSSModule {
font :string;
background :string;
}
interface ComponentButton extends ICSSModule {
width? :string | number;
height? :string | number;
border? :string;
}
// Используем так
const style = require<ComponentButton>('button.css');
style. // ⇦ Вот тут нет подсказок для ICSSModule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment