Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider exporting ResourceFunc and ResourceInput #5797

Closed
2 tasks done
kgilden opened this issue Sep 8, 2020 · 3 comments · May be fixed by fullcalendar/fullcalendar-workspace#569
Closed
2 tasks done

Consider exporting ResourceFunc and ResourceInput #5797

kgilden opened this issue Sep 8, 2020 · 3 comments · May be fixed by fullcalendar/fullcalendar-workspace#569

Comments

@kgilden
Copy link

kgilden commented Sep 8, 2020

Checklist

Please mark these items with an [x]

  • I've already searched through existing tickets
  • Other people will find this feature useful

Feature Description

In v4 both ResourceFunc and ResourceInput were exported and users could depend on these types. In v5 it seems that these two types didn't make it to the export list. A good reason for also exporting would be symmetry: EventSourceInput and EventSourceFunc are exported so as a user I would expect the same for resources. Would you consider exporting them?

If you're ok with this, I would gladly make a PR to fullcalendar-schedule as this is a trivial change.

@kgilden
Copy link
Author

kgilden commented Sep 11, 2020

As a workaround the following works.

import { RawOptionsFromRefiners } from '@fullcalendar/core';
import { ResourceSourceInput } from '@fullcalendar/resource-common';

type Unpacked<T> = T extends (infer U)[] ? U : T;

/**
 * The `ResourceFunc` type is not exported since v5 of fullcalendar. This
 * hack here works around that by extracting the `ResourceFunc`.
 */
export type ResourceFunc = Extract<ResourceSourceInput, (...args: any) => any>;

/**
 * The `ResourceInput` type is not exported since v5 of fullcalendar. This
 * hack here works around that by extracting the `ResourceInput`.
 */
export type ResourceInput = Unpacked<Exclude<ResourceSourceInput, string | ResourceFunc | RawOptionsFromRefiners<any>>>;

@arshaw arshaw added this to the next-release milestone Sep 21, 2020
@arshaw arshaw closed this as completed in 33b25af Oct 27, 2020
gongAll pushed a commit to gongAll/fullcalendar that referenced this issue Nov 3, 2020
@arshaw
Copy link
Member

arshaw commented Nov 12, 2020

this is implemented in 5.4.0 !

@kgilden
Copy link
Author

kgilden commented Nov 12, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants