import { ExplicitFoldingConfig , ExplicitFoldingHub } from '@zokugun/vscode.explicit-folding-api' ; export class FoldingHub implements ExplicitFoldingHub { private perLanguages : Record < string , ExplicitFoldingConfig [ ] | undefined > = { } ; private readonly setup : ( ) => void ; constructor ( setup ) { this . setup = setup ; } getRules ( language ) { return this . perLanguages [ language ] ; } hasRules ( language ) { return typeof this . perLanguages [ language ] !== 'undefined' ; } registerFoldingRules ( language , rules ) { this . perLanguages [ language ] = rules ; this . setup ( ) ; } unregisterFoldingRules ( language ) { this . perLanguages [ language ] = undefined ; this . setup ( ) ; } }