refactor(model): 🏷️ force type casting for toRef
method
This commit is contained in:
parent
aefdacbf59
commit
1fb1f1ce15
|
@ -1,5 +1,6 @@
|
|||
import type { Base64String, ToJson, UUID } from '@/types.ts'
|
||||
import { Ressource } from '@models/ressource.ts'
|
||||
import type { Ref } from '@models'
|
||||
|
||||
export class Credential<T extends CredentialCategory> extends Ressource {
|
||||
static fromJSON<T extends CredentialCategory>(
|
||||
|
@ -69,6 +70,10 @@ export class Credential<T extends CredentialCategory> extends Ressource {
|
|||
toString(): string {
|
||||
return `Credential (${JSON.stringify(this)})`
|
||||
}
|
||||
|
||||
toRef(): Ref<Credential<T>> {
|
||||
return super.toRef() as Ref<Credential<T>>
|
||||
}
|
||||
}
|
||||
|
||||
export interface Credential<T extends CredentialCategory> extends Ressource {
|
||||
|
|
|
@ -106,6 +106,10 @@ export class Group extends Ressource {
|
|||
toString(): string {
|
||||
return `Group (${JSON.stringify(this)})`
|
||||
}
|
||||
|
||||
toRef(): Ref<Group> {
|
||||
return super.toRef() as Ref<Group>
|
||||
}
|
||||
}
|
||||
|
||||
export interface Group extends Ressource {
|
||||
|
|
|
@ -93,6 +93,10 @@ export class Machine extends Ressource {
|
|||
toString(): string {
|
||||
return `Machine (${JSON.stringify(this)})`
|
||||
}
|
||||
|
||||
toRef(): Ref<Machine> {
|
||||
return super.toRef() as Ref<Machine>
|
||||
}
|
||||
}
|
||||
|
||||
export interface Machine extends Ressource {
|
||||
|
|
|
@ -119,6 +119,10 @@ export class Service extends Ressource {
|
|||
toString(): string {
|
||||
return `Service (${JSON.stringify(this)})`
|
||||
}
|
||||
|
||||
toRef(): Ref<Service> {
|
||||
return super.toRef() as Ref<Service>
|
||||
}
|
||||
}
|
||||
|
||||
export interface Service extends Ressource {
|
||||
|
|
|
@ -168,6 +168,10 @@ export class User extends Ressource {
|
|||
toString(): string {
|
||||
return `User (${JSON.stringify(this)})`
|
||||
}
|
||||
|
||||
toRef(): Ref<User> {
|
||||
return super.toRef() as Ref<User>
|
||||
}
|
||||
}
|
||||
|
||||
export interface User extends Ressource {
|
||||
|
|
Loading…
Reference in a new issue