<commit_before>import type { Constructor, RdfResource } from '@tpluscode/rdfine'
import type { HydraClient, HydraResponse } from '../../alcaeus'

declare module '@rdfine/hydra' {
    export interface Resource {
        load(): Promise<HydraResponse>
    }
}

export function createResourceLoaderMixin(alcaeus: HydraClient) {
    function ResourceLoaderMixin<Base extends Constructor>(base: Base) {
        return class extends base {
            public load() {
                return alcaeus.loadResource(this.id.value)
            }<commit_msg>fix: make load generic<commit_after>import type { Constructor, RdfResource } from '@tpluscode/rdfine'
import type { DatasetCore } from 'rdf-js'
import type { HydraClient, HydraResponse } from '../../alcaeus'

declare module '@tpluscode/rdfine' {
    export interface RdfResource<D extends DatasetCore = DatasetCore> {
        load?<T extends RdfResource<D>>(): Promise<HydraResponse<D, T>>
    }
}

export function createResourceLoaderMixin(alcaeus: HydraClient) {
    function ResourceLoaderMixin<Base extends Constructor>(base: Base) {
        return class extends base {
            public load<T extends RdfResource<any>>() {
                return alcaeus.loadResource<T>(this.id.value)
            }
{'fraction_non_alphanumeric': 0.10471622701838529, 'fraction_numerical': 0.0, 'mean_word_length': 3.4555160142348753, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4433460', 'n_tokens_mistral': 376, 'n_tokens_neox': 359, 'n_words': 90}