5.0.2 • Published 4 years ago

@types/keystonejs__list-plugins v5.0.2

Weekly downloads
147
License
MIT
Repository
github
Last release
4 years ago

Installation

npm install --save @types/keystonejs__list-plugins

Summary

This package contains type definitions for @keystonejs/list-plugins (https://github.com/keystonejs/keystone).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/keystonejs__list-plugins.

index.d.ts

// Type definitions for @keystonejs/list-plugins 5.0
// Project: https://github.com/keystonejs/keystone
// Definitions by: Kevin Brown <https://github.com/thekevinbrown>
//                 Timothee Clain <https://github.com/tclain>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.5

// Because this is a scoped package, without this line Typescript doesn't associate the
// types with the right package.
// tslint:disable-next-line:no-single-declare-module
declare module '@keystonejs/list-plugins' {
    import { BaseKeystoneAdapter, Plugin } from '@keystonejs/keystone';

    interface TrackingOptions {
        createdAtField?: string | undefined; // TODO: insert fields here
        updatedAtField?: string | undefined;
        access: any; // TODO: reuse the access controls type
    }
    interface AtTrackingOptions extends TrackingOptions {
        format?: string | undefined;
    }
    interface ByTrackingOptions extends TrackingOptions {
        ref?: string | undefined; // TODO: investigate list names
    }

    type AtTrackingPluginProvider = (options?: AtTrackingOptions) => Plugin;
    type ByTrackingPluginProvider = (options?: ByTrackingOptions) => Plugin;

    const atTracking: AtTrackingPluginProvider;
    const byTracking: ByTrackingPluginProvider;
}

Additional Details

Credits

These definitions were written by Kevin Brown, and Timothee Clain.