Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/drash/src/services/graphql/deps.ts>Drash.Interfaces.IKeyValuePairs

A microframework for Deno's HTTP server with zero third-party dependencies
Go to Latest
interface Drash.Interfaces.IKeyValuePairs
import { type Drash } from "https://deno.land/x/drash@v2.8.1/src/services/graphql/deps.ts";
const { IKeyValuePairs } = Drash.Interfaces;

An interface to help type key-value pair objects with different values.

Examples:

const myKvpObject: IKeyValuePairs<string> = {
  some_key: "some string",
};

const myKvpObject: IKeyValuePairs<number> = {
  some_key: 1,
};

interface SomeOtherInterface {
    [key: string]: number;
}
const myKvpObject: IKeyValuePairs<SomeOtherInterface> = {
  some_key: {
    some_other_key: 1
  },
};