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
4 changes: 2 additions & 2 deletions types/cookieclicker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"owners": [
{
"name": "Lubomir",
"githubUsername": "TheGLander"
"name": "Zee",
"githubUsername": "zyudneko"
},
{
"name": "Static Variable James",
Expand Down
4 changes: 2 additions & 2 deletions types/pg/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,9 @@ export class ClientBase extends events.EventEmitter {
setTypeParser: typeof pgTypes.setTypeParser;
getTypeParser: typeof pgTypes.getTypeParser;

on<E extends "drain" | "error" | "notice" | "notification" | "end">(
on<E extends "connect" | "drain" | "error" | "notice" | "notification" | "end">(
event: E,
listener: E extends "drain" | "end" ? () => void
listener: E extends "connect" | "drain" | "end" ? () => void
: E extends "error" ? (err: Error) => void
: E extends "notice" ? (notice: NoticeMessage) => void
: (message: Notification) => void,
Expand Down
4 changes: 4 additions & 0 deletions types/pg/pg-tests.mts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ const myFunc2 = (c: pg.Client) => {
c.on("drain", () => {});
};

const myFunc3 = (c: pg.Client) => {
c.on("connect", () => {});
};

// $ExpectType ClientBase
new pg.ClientBase();
// $ExpectType ClientBase
Expand Down
26 changes: 23 additions & 3 deletions types/plotly.js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,8 @@ export interface LayoutAxis extends Axis {
automargin: boolean;
angle: any;
griddash: Dash;
l2p: (v: Datum) => number;
l2p: (v: number) => number;
d2p: (v: Datum, clip?: any, calendar?: any) => number;

autotickangles: number[];
insiderange: any[];
Expand Down Expand Up @@ -1270,7 +1271,6 @@ export type ModeBarDefaultButtons =
| "zoomOutGeo"
| "resetGeo"
| "hoverClosestGeo"
| "hoverClosestGl2d"
| "hoverClosestPie"
| "toggleHover"
| "toImage"
Expand All @@ -1286,7 +1286,27 @@ export type ModeBarDefaultButtons =
| "togglehover"
| "hovercompare"
| "hoverclosest"
| "v1hovermode";
| "v1hovermode"
| "sendChartToCloud"
| "drawclosedpath"
| "drawopenpath"
| "drawline"
| "drawrect"
| "drawcircle"
| "eraseshape"
| "resetViewSankey"
| "zoom"
| "pan"
| "select"
| "lasso"
| "zoomin"
| "zoomout"
| "autoscale"
| "resetscale"
| "resetCameraDefault"
| "resetCameraLastSave"
| "reset"
| "resetView";

export type ButtonClickEvent = (gd: PlotlyHTMLElement, ev: MouseEvent) => void;

Expand Down
10 changes: 10 additions & 0 deletions types/plotly.js/test/index-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const config: Partial<Config> = {
modeBarButtonsToAdd: [
"togglespikelines",
"togglehover",
"drawrect",
"zoom",
{
name: "customButton",
title: "Custom Action",
Expand Down Expand Up @@ -1658,3 +1660,11 @@ function rand() {

Plotly.newPlot("myDiv", data, layout);
})();

(() => {
const axis = {} as Plotly.LayoutAxis;
const dataPixel: number = axis.d2p(2.5);
const logPixel: number = axis.d2p(2.5, true);
const datePixel: number = axis.d2p("2024-01-01", undefined, "gregorian");
const linearizedPixel: number = axis.l2p(2.5);
})();
21 changes: 20 additions & 1 deletion types/plotly.js/v2/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,26 @@ export type ModeBarDefaultButtons =
| "togglehover"
| "hovercompare"
| "hoverclosest"
| "v1hovermode";
| "v1hovermode"
| "drawclosedpath"
| "drawopenpath"
| "drawline"
| "drawrect"
| "drawcircle"
| "eraseshape"
| "resetViewSankey"
| "zoom"
| "pan"
| "select"
| "lasso"
| "zoomin"
| "zoomout"
| "autoscale"
| "resetscale"
| "resetCameraDefault"
| "resetCameraLastSave"
| "reset"
| "resetView";

export type ButtonClickEvent = (gd: PlotlyHTMLElement, ev: MouseEvent) => void;

Expand Down
2 changes: 2 additions & 0 deletions types/plotly.js/v2/test/index-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const config: Partial<Config> = {
modeBarButtonsToAdd: [
"togglespikelines",
"togglehover",
"drawrect",
"zoom",
{
name: "customButton",
title: "Custom Action",
Expand Down