@pipedream/types
Advanced tools
Comparing version
@@ -195,2 +195,4 @@ /// <reference types="node" /> | ||
max?: number; | ||
disabled?: boolean; | ||
hidden?: boolean; | ||
} | ||
@@ -254,9 +256,16 @@ export interface InterfaceProp extends BasePropInterface { | ||
} | ||
export interface IdEmitMetadata extends EmitMetadata { | ||
id: string | number; | ||
} | ||
type EmitFunction = { | ||
$emit: (event: JSONValue, metadata?: EmitMetadata) => Promise<void>; | ||
}; | ||
type IdEmitFunction = { | ||
$emit: (event: JSONValue, metadata: IdEmitMetadata) => Promise<void>; | ||
}; | ||
type PropThis<Props> = { | ||
[Prop in keyof Props]: Props[Prop] extends App<Methods, AppPropDefinitions> ? any : any; | ||
}; | ||
export interface Source<Methods, SourcePropDefinitions> { | ||
type Modify<T, R> = Omit<T, keyof R> & R; | ||
interface BaseSource<Methods, SourcePropDefinitions> { | ||
key: string; | ||
@@ -274,2 +283,7 @@ name?: string; | ||
} | ||
export type DedupedSource<Methods, SourcePropDefinitions> = Modify<BaseSource<Methods, SourcePropDefinitions>, { | ||
dedupe: "last" | "greatest" | "unique"; | ||
run: (this: PropThis<SourcePropDefinitions> & Methods & IdEmitFunction, options?: SourceRunOptions) => void | Promise<void>; | ||
}>; | ||
export type Source<Methods, SourcePropDefinitions> = DedupedSource<Methods, SourcePropDefinitions>; | ||
export declare function defineSource<Methods, SourcePropDefinitions>(component: Source<Methods, SourcePropDefinitions>): Source<Methods, SourcePropDefinitions>; | ||
@@ -276,0 +290,0 @@ export interface Action<Methods, ActionPropDefinitions> { |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */ | ||
const Pipedream = __importStar(require("./index")); | ||
const stringData = "foo"; | ||
@@ -319,1 +344,12 @@ const num = 3; | ||
}; | ||
Pipedream.defineSource({ | ||
key: "source", | ||
version: "0.0.1", | ||
type: "source", | ||
dedupe: "unique", | ||
run() { | ||
this.$emit({}, | ||
// @ts-expect-error $ExpectError - Missing id property in metadata object | ||
{}); | ||
}, | ||
}); |
{ | ||
"name": "@pipedream/types", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Pipedream TypeScript types", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
25520
8.77%669
8.08%2
100%