mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Started adding types. * Missed these changes. * Adding types. * Should be good. * Should be good to go. * Updated prettier formatting. * Updated prettier formatting. * Updated prettier. * Changed to ReadonlyArray. * Modified as per review. * Modified with other recommended changes.
38 lines
771 B
TypeScript
38 lines
771 B
TypeScript
import { cache, Component, events, instance, util, Service } from 'sauronjs';
|
|
|
|
events.dom.update();
|
|
|
|
// $ExpectType Component
|
|
new Component({ element: new HTMLElement() });
|
|
|
|
class SomeComponent extends Component {}
|
|
|
|
// $ExpectType SomeComponent
|
|
const example = new SomeComponent({ element: new HTMLElement() });
|
|
|
|
util.insert(new HTMLElement());
|
|
util.ready(() => {
|
|
'example';
|
|
});
|
|
|
|
// $ExpectType Service
|
|
new Service(['examplePublisher'], ['exampleSubscription']);
|
|
|
|
class ExampleService extends Service {
|
|
constructor() {
|
|
super(['examplePublisher'], ['exampleSubscription']);
|
|
}
|
|
}
|
|
|
|
// $ExpectType ExampleService
|
|
new ExampleService();
|
|
|
|
// $ExpectType Cache
|
|
cache('test');
|
|
|
|
// $ExpectType void
|
|
cache();
|
|
|
|
// $ExpectType SauronInstance
|
|
instance({ example });
|