Skip to content

Commit

Permalink
refactor(types): restricts which utility types are exported by library
Browse files Browse the repository at this point in the history
BREAKING CHANGE: types `AliasesMap`, `TaggedInterface`, `AbilityTupleType`, `ToAbilityTypes`, `AnyObject` are no longer exported by the library
  • Loading branch information
stalniy committed Nov 2, 2020
1 parent 65c32e1 commit e98618f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion packages/casl-ability/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,27 @@ export * from './PureAbility';
export * from './AbilityBuilder';
export * from './ForbiddenError';
export * from './RawRule';
export * from './types';
export * from './hkt';
export * from './matchers/conditions';
export * from './matchers/field';
export type {
SubjectClass,
SubjectType,
Subject,
AbilityTuple,
Abilities,
Normalize,
IfString,
AbilityParameters,
CanParameters,
ExtractSubjectType,
InferSubjects,
ForcedSubject,
MatchConditions,
ConditionsMatcher,
MatchField,
FieldMatcher,
} from './types';
export type {
Generics,
RuleOf,
Expand Down
2 changes: 1 addition & 1 deletion packages/casl-ability/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Condition } from '@ucast/mongo2js';
import { Container, GenericFactory } from './hkt';

type Fn = (...args: any[]) => any;
type AnyClass<ReturnType = any> = new (...args: any[]) => ReturnType;
export type AnyClass<ReturnType = any> = new (...args: any[]) => ReturnType;
type AnyRecord = Record<PropertyKey, any>;

export type AnyObject = Record<PropertyKey, unknown>;
Expand Down

0 comments on commit e98618f

Please sign in to comment.