
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
elm-ts-interop
Advanced tools
The ports and flags in an Elm app (also called JS interop) have a shape to them. You can write that shape out with a TypeScript type to make sure the types match up between your Elm and TypeScript code. You could write a definition like this:
export interface ElmApp {
ports: {
interopFromElm: PortFromElm<FromElm>;
interopToElm: PortToElm<ToElm>;
};
}
export type FromElm =
| { tag: "reportError"; data: { message: string; name: string } }
| { tag: "tryLogIn"; data: null };
export type ToElm =
| {
tag: "onAuthenticated";
data: { isPro: boolean; user: { avatarUrl: string } };
}
| { tag: "onNewGeneratedElm"; data: string };
export type Flags = null;
export namespace Main {
function init(options: { node?: HTMLElement | null; flags: Flags }): ElmApp;
}
export as namespace Elm;
export { Elm };
export type PortFromElm<Data> = {
subscribe(callback: (fromElm: Data) => void): void;
};
export type PortToElm<Data> = { send(data: Data): void };
This is great because now we can safely wire up our Elm application and use ports to send and receive data! But if we wrote it by hand, then it's error prone and likely to get out of date.
That's exactly what elm-ts-interop
is designed to help with. This is the workflow to generate a TypeScript Declaration similar to the example above:
InteropDefinitions.elm
with Encoders/Decoders for your Flags and Portselm-ts-json
so they have type information that lets elm-ts-interop
sync them to a TypeScript Declarationelm-ts-interop
command-line tool to generate types from your Ports and Flags in InteropDefinitions.elm
Run npx elm-ts-interop init
from the root of your Elm project to copy an initial InteropDefinitions.elm
and InteropPorts.elm
file. From there, npx elm-ts-interop
will generate your TypeScript Declaration file.
More docs at elm-ts-interop.com/setup.
FAQs
## How It Works
The npm package elm-ts-interop receives a total of 836 weekly downloads. As such, elm-ts-interop popularity was classified as not popular.
We found that elm-ts-interop demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.