Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions types/event-calendar__core/event-calendar__core-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ cal.removeEventById(345)
end: new Date(Date.now() + 2 * 60 * 60 * 1000),
});
cal.refetchEvents();
cal.refetchResources();
cal.dateFromPoint(0, 0);
cal.getView();
cal.next();
Expand Down Expand Up @@ -136,6 +137,7 @@ cal = createCalendar(target, plugins, {
click: () => undefined,
},
},
customScrollbars: true,
date: "1997-04-12",
dateClick: (_info: Calendar.DateClickInfo) => {},
datesAboveResources: false,
Expand Down Expand Up @@ -205,18 +207,22 @@ cal = createCalendar(target, plugins, {
height: "100%",
hiddenDays: [2],
highlightedDates: ["2024-01-01", new Date()],
icons: { collapse: { html: "−" }, expand: { html: "+" } },
lazyFetching: true,
listDayFormat: dateFormat,
listDaySideFormat: dateFormat,
loading: (_isLoading: boolean) => {},
locale: "en-US",
longPressDelay: 100,
monthHeaderFormat: { month: "long" },
moreLinkContent: "content",
noEventsClick: (_info: Calendar.NoEventsClickInfo) => {},
noEventsContent: "content",
nowIndicator: true,
pointer: true,
refetchResourcesOnNavigate: true,
resizeConstraint: (_info: Calendar.EventResizeInfo) => true,
resourceExpand: (_info: Calendar.ResourceExpandInfo) => {},
resources: [{ id: "foo" }, { id: "bar", extendedProps: { fred: "barney" } }],
resourceLabelContent: "content",
resourceLabelDidMount: (_info: Calendar.ResourceDidMountInfo) => {},
Expand All @@ -237,6 +243,7 @@ cal = createCalendar(target, plugins, {
slotMinTime: 300,
slotMaxTime: "04:00:00",
slotWidth: 100,
snapDuration: 200,
theme: defaultTheme,
titleFormat: dateFormat,
unselect: (_info: Calendar.UnselectInfo) => {},
Expand Down Expand Up @@ -275,8 +282,10 @@ cal.setOption("buttonText", () => {
})
.setOption("eventTimeFormat", (_start: Date, _end: Date) => "content")
.setOption("flexibleSlotTimeLimits", { eventFilter: (_ev: Calendar.Event) => false })
.setOption("icons", (_icons: Calendar.Icons) => ({ expand: "content" }))
.setOption("listDayFormat", (_d: Date) => "content")
.setOption("listDaySideFormat", (_d: Date) => "content")
.setOption("monthHeaderFormat", (_date: Date) => "content")
.setOption("moreLinkContent", (_info: Calendar.MoreLinkInfo) => "content")
.setOption("noEventsContent", () => "content")
.setOption("resourceLabelContent", (_info: Calendar.ResourceLabelInfo) => "content")
Expand Down
17 changes: 17 additions & 0 deletions types/event-calendar__core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface Calendar {
removeEventById(id: number | string): Calendar;
updateEvent(event: Calendar.Event | Calendar.EventInput): Calendar;
refetchEvents(): Calendar;
refetchResources(): Calendar;
dateFromPoint(x: number, y: number): Calendar.DateClickInfo | null;
getView(): Calendar.View;
next(): Calendar;
Expand Down Expand Up @@ -59,6 +60,10 @@ export namespace Calendar {
[key: string]: CustomButton;
}

interface Icons {
[key: string]: Content;
}

interface View {
type: string;
title: string;
Expand Down Expand Up @@ -224,6 +229,12 @@ export namespace Calendar {
view: View;
}

interface ResourceExpandInfo {
resource: Resource;
jsEvent: DomEvent;
view: View;
}

interface ResourceLabelInfo {
resource: Resource;
date: Date;
Expand Down Expand Up @@ -312,6 +323,7 @@ export namespace Calendar {
buttonText?: ButtonTextMapping | ((text: ButtonTextMapping) => ButtonTextMapping);
columnWidth?: cssLength;
customButtons?: CustomButtons | ((customButtons: CustomButtons) => CustomButtons);
customScrollbars?: boolean;
date?: Date | string | undefined;
dateClick?: (info: DateClickInfo) => void;
datesAboveResources?: boolean;
Expand Down Expand Up @@ -364,18 +376,22 @@ export namespace Calendar {
height?: string;
hiddenDays?: dayOfWeek[];
highlightedDates?: Array<isoDateString | Date>;
icons?: Icons | ((icons: Icons) => Icons);
lazyFetching?: boolean;
listDayFormat?: Intl.DateTimeFormatOptions | ((d: Date) => Content);
listDaySideFormat?: Intl.DateTimeFormatOptions | ((d: Date) => Content);
loading?: (isLoading: boolean) => void;
locale?: string;
longPressDelay?: number;
monthHeaderFormat?: Intl.DateTimeFormatOptions | ((date: Date) => Content);
moreLinkContent?: Content | ((info: MoreLinkInfo) => Content);
noEventsClick?: (info: NoEventsClickInfo) => void;
noEventsContent?: Content | (() => Content);
nowIndicator?: boolean;
pointer?: boolean;
refetchResourcesOnNavigate?: boolean;
resizeConstraint?: (info: EventResizeInfo) => boolean;
resourceExpand?: (info: ResourceExpandInfo) => void;
resources?: ResourceInput[];
resourceLabelContent?: Content | ((info: ResourceLabelInfo) => Content);
resourceLabelDidMount?: (info: ResourceDidMountInfo) => void;
Expand All @@ -394,6 +410,7 @@ export namespace Calendar {
slotMaxTime?: DurationInput;
slotMinTime?: DurationInput;
slotWidth?: number;
snapDuration?: DurationInput;
theme?: Theme | ((theme: Theme) => Theme);
titleFormat?: Intl.DateTimeFormatOptions | ((start: Date, end: Date) => Content);
unselect?: (info: UnselectInfo) => void;
Expand Down
2 changes: 1 addition & 1 deletion types/event-calendar__core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": true,
"type": "module",
"name": "@types/event-calendar__core",
"version": "5.0.9999",
"version": "5.5.9999",
"projects": [
"https://vkurko.github.io/calendar/"
],
Expand Down
6 changes: 5 additions & 1 deletion types/k6/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/k6",
"version": "1.6.9999",
"version": "1.7.9999",
"type": "module",
"projects": [
"https://grafana.com/docs/k6/latest/"
Expand Down Expand Up @@ -58,6 +58,10 @@
{
"name": "Agnès Toulet",
"githubUsername": "AgnesToulet"
},
{
"name": "Iván Szkiba",
"githubUsername": "szkiba"
}
]
}
43 changes: 21 additions & 22 deletions types/mssql/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,28 +216,27 @@ export interface config {
beforeConnect?: ((conn: Connection) => void) | undefined;
}

export declare enum MSSQL_ERROR_CODE {
ELOGIN = "ELOGIN",
ETIMEOUT = "ETIMEOUT",
EDRIVER = "EDRIVER",
EALREADYCONNECTED = "EALREADYCONNECTED",
EALREADYCONNECTING = "EALREADYCONNECTING",
ENOTOPEN = "ENOTOPEN",
EINSTLOOKUP = "EINSTLOOKUP",
ESOCKET = "ESOCKET",
ECONNCLOSED = "ECONNCLOSED",
ENOTBEGUN = "ENOTBEGUN",
EALREADYBEGUN = "EALREADYBEGUN",
EREQINPROG = "EREQINPROG",
EABORT = "EABORT",
EREQUEST = "EREQUEST",
ECANCEL = "ECANCEL",
EARGS = "EARGS",
EINJECT = "EINJECT",
ENOCONN = "ENOCONN",
EALREADYPREPARED = "EALREADYPREPARED",
ENOTPREPARED = "ENOTPREPARED",
}
export type MSSQL_ERROR_CODE =
| "ELOGIN"
| "ETIMEOUT"
| "EDRIVER"
| "EALREADYCONNECTED"
| "EALREADYCONNECTING"
| "ENOTOPEN"
| "EINSTLOOKUP"
| "ESOCKET"
| "ECONNCLOSED"
| "ENOTBEGUN"
| "EALREADYBEGUN"
| "EREQINPROG"
| "EABORT"
| "EREQUEST"
| "ECANCEL"
| "EARGS"
| "EINJECT"
| "ENOCONN"
| "EALREADYPREPARED"
| "ENOTPREPARED";

export declare class MSSQLError extends Error {
constructor(message: Error | string, code?: MSSQL_ERROR_CODE);
Expand Down
10 changes: 5 additions & 5 deletions types/mssql/mssql-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,11 @@ function test_mssql_errors() {
// Test constructors
const sqlDriverError = new Error("mock error");
const mssqlStringError = new sql.MSSQLError("Something went wrong");
const baseMSSQLError = new sql.MSSQLError(sqlDriverError, sql.MSSQL_ERROR_CODE.EREQUEST);
const connectionError = new sql.ConnectionError(sqlDriverError, sql.MSSQL_ERROR_CODE.ELOGIN);
const requestError = new sql.RequestError(sqlDriverError, sql.MSSQL_ERROR_CODE.EREQUEST);
const preparedStatementError = new sql.PreparedStatementError(sqlDriverError, sql.MSSQL_ERROR_CODE.EINJECT);
const transactionError = new sql.TransactionError(sqlDriverError, sql.MSSQL_ERROR_CODE.EABORT);
const baseMSSQLError = new sql.MSSQLError(sqlDriverError, "EREQUEST");
const connectionError = new sql.ConnectionError(sqlDriverError, "ELOGIN");
const requestError = new sql.RequestError(sqlDriverError, "EREQUEST");
const preparedStatementError = new sql.PreparedStatementError(sqlDriverError, "EINJECT");
const transactionError = new sql.TransactionError(sqlDriverError, "EABORT");

// Test inheritance
if (
Expand Down
Loading