Is the "@ory/permission-namespace-types" from <thi...
# talk-keto
l
Is the "@ory/permission-namespace-types" from this article a public library/will it be? I'm starting to learn/use the OPL and annoyingly my IDE will always be suggesting I import Namespace etc. from the @ory/client library
p
For my POC I added the following to
@ory/permission-namespace-types.ts
just to get my IDE to stop complaining:
Copy code
/* Ory Permission Language Builtin Types
    <https://www.ory.sh/docs/keto/reference/ory-permission-language#builtin-types>
 */
export type Context = { subject: never }

export interface Namespace {
    related?: { [relation: string]: Namespace[] }
    permits?: { [method: string]: (ctx: Context) => boolean }
}

export interface Array<Namespace> {
    includes(element: Namespace): boolean

    traverse(iteratorfn: (element: Namespace) => boolean): boolean
}

export type SubjectSet<A extends Namespace, R extends keyof A["related"]> = A["related"][R] extends Array<infer T> ? T : never
l
Thanks! I'll do this. It would be nice to see an official release though