Skip to content

Commit

Permalink
remove ProhibitedType from autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored and mikearnaldi committed Oct 1, 2024
1 parent 09e60cd commit 481a745
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/effect/src/Effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6337,21 +6337,21 @@ export const Service: <Self>() => {
const Key extends string,
const Make extends
| NoExcessProperties<{
readonly scoped: Effect<Service.AllowedType<Key, Make["accessors"]>, any, any>
readonly scoped: Effect<Service.AllowedType<Key, Make>, any, any>
readonly dependencies?: ReadonlyArray<Layer.Layer.Any>
readonly accessors?: boolean
}, Make>
| NoExcessProperties<{
readonly effect: Effect<Service.AllowedType<Key, Make["accessors"]>, any, any>
readonly effect: Effect<Service.AllowedType<Key, Make>, any, any>
readonly dependencies?: ReadonlyArray<Layer.Layer.Any>
readonly accessors?: boolean
}, Make>
| NoExcessProperties<{
readonly sync: LazyArg<Service.AllowedType<Key, Make["accessors"]>>
readonly sync: LazyArg<Service.AllowedType<Key, Make>>
readonly accessors?: boolean
}, Make>
| NoExcessProperties<{
readonly succeed: Service.AllowedType<Key, Make["accessors"]>
readonly succeed: Service.AllowedType<Key, Make>
readonly accessors?: boolean
}, Make>
>(
Expand Down Expand Up @@ -6474,13 +6474,18 @@ export declare namespace Service {
name?: `property "name" is forbidden`
pipe?: `property "pipe" is forbidden`
use?: `property "use" is forbidden`
_tag?: `property "_tag" is forbidden`
}

/**
* @since 3.9.0
*/
export type AllowedType<Key extends string, Accessors extends boolean | undefined> = [Accessors] extends [true]
? Record<PropertyKey, any> & ProhibitedType & { readonly _tag?: Key }
export type AllowedType<Key extends string, Make> = MakeAccessors<Make> extends true ?
& Record<PropertyKey, any>
& {
readonly [K in Extract<keyof MakeService<Make>, keyof ProhibitedType>]: K extends "_tag" ? Key
: ProhibitedType[K]
}
: Record<PropertyKey, any> & { readonly _tag?: Key }

/**
Expand Down

0 comments on commit 481a745

Please sign in to comment.