When you add: import Danger to the top of your Dangerfile it exposes a bunch of stuff. First up, there arre the messaging functions

import Darwin
import Darwin.C
import Foundation
import Logger
import OctoKit
import ShellOut
import SwiftOnoneSupport

struct BitBucketServer {
    /// The pull request and repository metadata
    let metadata: BitBucketServerMetadata

    /// The pull request metadata
    let pullRequest: BitBucketServerPR

    /// The commits associated with the pull request
    let commits: [BitBucketServerCommit]

    /// The comments on the pull request
    let comments: [BitBucketServerComment]

    /// The activities such as OPENING, CLOSING, MERGING or UPDATING a pull request
    let activities: [BitBucketServerActivity]
}

struct BitBucketServerActivity {
    /// The activity's ID
    let id: Int

    /// Date activity created as number of mili seconds since the unix epoch
    let createdAt: Int

    /// The user that triggered the activity.
    let user: BitBucketServerUser

    /// The action the activity describes (e.g. "COMMENTED").
    let action: String

    /// In case the action was "COMMENTED" it will state the command specific action (e.g. "CREATED").
    let commentAction: String?
}

struct BitBucketServerComment {
    /// The comment's id
    let id: Int

    /// Date comment created as number of mili seconds since the unix epoch
    let createdAt: Int

    /// The comment's author
    let user: BitBucketServerUser

    /// The action the user did (e.g. "COMMENTED")
    let action: String

    /// The SHA to which the comment was created
    let fromHash: String?

    /// The previous SHA to which the comment was created
    let previousFromHash: String?

    /// The next SHA after the comment was created
    let toHash: String?

    /// The SHA to which the comment was created
    let previousToHash: String?

    /// Action the user did (e.g. "ADDED") if it is a new task
    let commentAction: String?

    /// Detailed data of the comment
    let comment: BitBucketServerComment.CommentDetail?

    struct CommentDetail {
        /// The comment's id
        let id: Int

        /// The comment's version
        let version: Int

        /// The comment content
        let text: String

        /// The author of the comment
        let author: BitBucketServerUser

        /// Date comment created as number of mili seconds since the unix epoch
        let createdAt: Int

        /// Date comment updated as number of mili seconds since the unix epoch
        let updatedAt: Int

        /// Replys to the comment
        let comments: [BitBucketServerComment.CommentDetail]

        /// Properties associated with the comment
        let properties: BitBucketServerComment.CommentDetail.InnerProperties

        /// Tasks associated with the comment
        let tasks: [BitBucketServerComment.CommentDetail.BitBucketServerCommentTask]

        struct BitBucketServerCommentTask {
            /// The tasks ID
            let id: Int

            /// Date activity created as number of mili seconds since the unix epoch
            let createdAt: Int

            /// The text of the task
            let text: String

            /// The state of the task (e.g. "OPEN")
            let state: String

            /// The author of the comment
            let author: BitBucketServerUser
        }

        struct InnerProperties {
            /// The ID of the repo
            let repositoryId: Int

            /// Slugs of linkd Jira issues
            let issues: [String]?
        }
    }
}

struct BitBucketServerCommit {
    /// The SHA for the commit
    let id: String

    /// The shortened SHA for the commit
    let displayId: String

    /// The author of the commit, assumed to be the person who wrote the code.
    let author: BitBucketServerUser

    /// The UNIX timestamp for when the commit was authored
    let authorTimestamp: Int

    /// The author of the commit, assumed to be the person who commited/merged the code into a project.
    let committer: BitBucketServerUser?

    /// When the commit was commited to the project
    let committerTimestamp: Int?

    /// The commit's message
    let message: String

    /// The commit's parents
    let parents: [BitBucketServerCommit.BitBucketServerCommitParent]

    struct BitBucketServerCommitParent {
        /// The SHA for the commit
        let id: String

        /// The shortened SHA for the commit
        let displayId: String
    }
}

struct BitBucketServerMergeRef {
    /// The branch name
    let id: String

    /// The human readable branch name
    let displayId: String

    /// The SHA for the latest commit
    let latestCommit: String

    /// Info of the associated repository
    let repository: BitBucketServerRepo
}

struct BitBucketServerMetadata {
    /// The PR's ID
    var pullRequestID: String

    /// The complete repo slug including project slug.
    var repoSlug: String
}

struct BitBucketServerPR {
    /// The PR's ID
    let id: Int

    /// The API version
    let version: Int

    /// Title of the pull request.
    let title: String

    /// The description of the PR
    let description: String?

    /// The pull request's current status.
    let state: String

    /// Is PR open?
    let open: Bool

    /// Is PR closed?
    let closed: Bool

    /// Date PR created as number of mili seconds since the unix epoch
    let createdAt: Int

    /// Date PR updated as number of mili seconds since the unix epoch
    let updatedAt: Int?

    /// The PR submittor's reference
    let fromRef: BitBucketServerMergeRef

    /// The repo Danger is running on
    let toRef: BitBucketServerMergeRef

    /// Is the PR locked?
    let isLocked: Bool

    /// The creator of the PR
    let author: BitBucketServerPR.Participant

    /// People requested as reviewers
    let reviewers: [BitBucketServerPR.Reviewer]

    /// People who have participated in the PR
    let participants: [BitBucketServerPR.Participant]

    /// A user that is parecipating in the PR
    struct Participant {
        /// The BitBucket Server User
        let user: BitBucketServerUser
    }

    /// A user that reviewed the PR
    struct Reviewer {
        /// The BitBucket Server User
        let user: BitBucketServerUser

        /// The approval status
        let approved: Bool

        /// The commit SHA for the latest commit that was reviewed
        let lastReviewedCommit: String?
    }
}

struct BitBucketServerProject {
    /// The project unique id
    let id: Int

    /// The project's human readable project key
    let key: String

    /// The name of the project
    let name: String

    /// Is the project publicly available
    let isPublic: Bool

    let type: String
}

struct BitBucketServerRepo {
    /// The repo name
    let name: String?

    /// The slug for the repo
    let slug: String

    /// The type of SCM tool, probably "git"
    let scmId: String

    /// Is the repo public?
    let isPublic: Bool

    /// Can someone fork thie repo?
    let forkable: Bool

    /// An abtraction for grouping repos
    let project: BitBucketServerProject
}

struct BitBucketServerUser {
    /// The unique user ID
    let id: Int?

    /// The name of the user
    let name: String

    /// The name to use when referencing the user
    let displayName: String?

    /// The email for the user
    let emailAddress: String

    /// Is the account active
    let active: Bool?

    /// The user's slug for URLs
    let slug: String?

    /// The type of a user, "NORMAL" being a typical user3
    let type: String?
}

struct DSL: Decodable {
    /// The root danger import
    let danger: DangerDSL
}

func Danger() -> DangerDSL

struct DangerDSL: Decodable {
    let git: Git

    private(set) var github: GitHub!

    let bitbucketServer: BitBucketServer!

    let utils: DangerUtils

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    init(from decoder: Decoder) throws
}

extension DangerDSL {
    /// Fails on the Danger report
    var fails: [Violation] { get }

    /// Warnings on the Danger report
    var warnings: [Violation] { get }

    /// Messages on the Danger report
    var messages: [Violation] { get }

    /// Markdowns on the Danger report
    var markdowns: [Violation] { get }

    /// Adds a warning message to the Danger report
    ///
    /// - Parameter message: A markdown-ish
    func warn(_ message: String)

    /// Adds an inline warning message to the Danger report
    func warn(message: String, file: String, line: Int)

    /// Adds a warning message to the Danger report
    ///
    /// - Parameter message: A markdown-ish
    func fail(_ message: String)

    /// Adds an inline fail message to the Danger report
    func fail(message: String, file: String, line: Int)

    /// Adds a warning message to the Danger report
    ///
    /// - Parameter message: A markdown-ish
    func message(_ message: String)

    /// Adds an inline message to the Danger report
    func message(message: String, file: String, line: Int)

    /// Adds a warning message to the Danger report
    ///
    /// - Parameter message: A markdown-ish
    func markdown(_ message: String)

    /// Adds an inline message to the Danger report
    func markdown(message: String, file: String, line: Int)

    /// Adds an inline suggestion to the Danger report (sends a normal message if suggestions are not supported)
    func suggestion(code: String, file: String, line: Int)
}

/// Utility functions that make Dangerfiles easier to write
struct DangerUtils {
    /// Let's you go from a file path to the contents of the file
    /// with less hassle.
    ///
    /// It specifically assumes golden path code so Dangerfiles
    /// don't have to include error handlings - an error will
    /// exit evaluation entirely as it should only happen at dev-time.
    ///
    /// - Parameter file: the file reference from git.modified/creasted/deleted etc
    /// - Returns: the file contents, or bails
    func readFile(_ file: File) -> String

    /// Returns the line number of the lines that contain a specific string in a file
    ///
    /// - Parameter string: The string you want to search
    /// - Parameter file: The file path of the file where you want to search the string
    /// - Returns: the line number of the lines where the passed string is contained
    func lines(for string: String, inFile file: File) -> [Int]

    /// Gives you the ability to cheaply run a command and read the
    /// output without having to mess around
    ///
    /// It generally assumes that the command will pass, as you only get
    /// a string of the STDOUT. If you think your command could/should fail
    /// then you want to use `spawn` instead.
    ///
    /// - Parameter command: The first part of the command
    /// - Parameter arguments: An optional array of arguements to pass in extra
    /// - Returns: the stdout from the command
    func exec(_ command: String, arguments: [String] = default) -> String

    /// Gives you the ability to cheaply run a command and read the
    /// output without having to mess around too much, and exposes
    /// command errors in a pretty elegant way.
    ///
    /// - Parameter command: The first part of the command
    /// - Parameter arguments: An optional array of arguements to pass in extra
    /// - Returns: the stdout from the command
    func spawn(_ command: String, arguments: [String] = default) throws -> String
}

/// A simple typealias for strings representing files
typealias File = String

enum FileType: String, Equatable {
    case h

    case json

    case m

    case markdown

    case mm

    case pbxproj

    case plist

    case storyboard

    case swift

    case xcscheme

    case yaml

    case yml
}

extension FileType: CaseIterable {}

extension FileType {
    var `extension`: String { get }
}

/// The git specific metadata for a pull request.
struct Git {
    /// Modified filepaths relative to the git root.
    let modifiedFiles: [File]

    /// Newly created filepaths relative to the git root.
    let createdFiles: [File]

    /// Removed filepaths relative to the git root.
    let deletedFiles: [File]
}

/// A platform agnostic reference to a git commit.
struct GitCommit {
    /// The SHA for the commit.
    let sha: String?

    /// Who wrote the commit.
    let author: GitCommitAuthor

    /// Who shipped the code.
    let committer: GitCommitAuthor

    /// The message for the commit.
    let message: String

    /// SHAs for the commit's parents.
    let parents: [String]?

    /// The URL for the commit.
    let url: String
}

/// The author of a commit.
struct GitCommitAuthor {
    /// The display name for the author.
    let name: String

    /// The email for the author.
    let email: String

    /// The ISO8601 date string for the commit.
    let date: String
}

/// The GitHub metadata for your pull request.
struct GitHub: Decodable {
    let issue: GitHubIssue

    let pullRequest: GitHubPR

    let commits: [GitHubCommit]

    let reviews: [GitHubReview]

    let requestedReviewers: GitHubRequestedReviewers

    internal(set) var api: OctoKit.Octokit!
}

/// A GitHub specific implementation of a git commit.
struct GitHubCommit {
    /// The SHA for the commit.
    let sha: String

    /// The raw commit metadata.
    let commit: GitCommit

    /// The URL for the commit on GitHub.
    let url: String

    /// The GitHub user who wrote the code.
    let author: GitHubUser?

    /// The GitHub user who shipped the code.
    let committer: GitHubUser?
}

struct GitHubIssue {
    enum IssueState: String, Decodable {
        case open

        case closed

        case locked
    }

    /// The id number of the issue
    let id: Int

    /// The number of the issue.
    let number: Int

    /// The title of the issue.
    let title: String

    /// The user who created the issue.
    let user: GitHubUser

    /// The state for the issue: open, closed, locked.
    let state: GitHubIssue.IssueState

    /// A boolean indicating if the issue has been locked to contributors only.
    let isLocked: Bool

    /// The markdown body message of the issue.
    let body: String

    /// The comment number of comments for the issue.
    let commentCount: Int

    /// The user who is assigned to the issue.
    let assignee: GitHubUser?

    /// The users who are assigned to the issue.
    let assignees: [GitHubUser]

    /// The milestone of this issue
    let milestone: GitHubMilestone?

    /// The ISO8601 date string for when the issue was created.
    let createdAt: Date

    /// The ISO8601 date string for when the issue was updated.
    let updatedAt: Date

    /// The ISO8601 date string for when the issue was closed.
    let closedAt: Date?

    /// The labels associated with this issue.
    let labels: [GitHubIssueLabel]
}

struct GitHubIssueLabel {
    /// The id number of this label.
    let id: Int

    /// The URL that links to this label.
    let url: String

    /// The name of the label.
    let name: String

    /// The color associated with this label.
    let color: String
}

/// Represents 'head' in PR
struct GitHubMergeRef {
    /// The human display name for the merge reference, e.g. "artsy:master".
    let label: String

    /// The reference point for the merge, e.g. "master"
    let ref: String

    /// The reference point for the merge, e.g. "704dc55988c6996f69b6873c2424be7d1de67bbe"
    let sha: String

    /// The user that owns the merge reference e.g. "artsy"
    let user: GitHubUser

    /// The repo from which the reference comes from
    let repo: GitHubRepo
}

struct GitHubMilestone {
    enum MilestoneState: String, Decodable {
        case open

        case closed

        case all
    }

    /// The id number of this milestone
    let id: Int

    /// The number of this milestone
    let number: Int

    /// The state of this milestone: open, closed, all
    let state: GitHubMilestone.MilestoneState

    /// The title of this milestone
    let title: String

    /// The description of this milestone.
    let description: String

    /// The user who created this milestone.
    let creator: GitHubUser

    /// The number of open issues in this milestone
    let openIssues: Int

    /// The number of closed issues in this milestone
    let closedIssues: Int

    /// The ISO8601 date string for when this milestone was created.
    let createdAt: Date

    /// The ISO8601 date string for when this milestone was updated.
    let updatedAt: Date

    /// The ISO8601 date string for when this milestone was closed.
    let closedAt: Date?

    /// The ISO8601 date string for the due of this milestone.
    let dueOn: Date?
}

struct GitHubPR {
    enum PullRequestState: String, Decodable {
        case open

        case closed

        case merged

        case locked
    }

    /// The number of the pull request.
    let number: Int

    /// The title of the pull request.
    let title: String

    /// The markdown body message of the pull request.
    let body: String

    /// The user who submitted the pull request.
    let user: GitHubUser

    /// The user who is assigned to the pull request.
    let assignee: GitHubUser?

    /// The users who are assigned to the pull request.
    let assignees: [GitHubUser]?

    /// The ISO8601 date string for when the pull request was created.
    let createdAt: Date

    /// The ISO8601 date string for when the pull request was updated.
    let updatedAt: Date

    /// The ISO8601 date string for when the pull request was closed.
    let closedAt: Date?

    /// The ISO8601 date string for when the pull request was merged.
    let mergedAt: Date?

    /// The merge reference for the _other_ repo.
    let head: GitHubMergeRef

    /// The merge reference for _this_ repo.
    let base: GitHubMergeRef

    /// The state for the pull request: open, closed, locked, merged.
    let state: GitHubPR.PullRequestState

    /// A boolean indicating if the pull request has been locked to contributors only.
    let isLocked: Bool

    /// A boolean indicating if the pull request has been merged.
    let isMerged: Bool?

    /// The number of commits in the pull request.
    let commitCount: Int?

    /// The number of comments in the pull request.
    let commentCount: Int?

    /// The number of review-specific comments in the pull request.
    let reviewCommentCount: Int?

    /// The number of added lines in the pull request.
    let additions: Int?

    /// The number of deleted lines in the pull request.
    let deletions: Int?

    /// The number of files changed in the pull request.
    let changedFiles: Int?

    /// The milestone of the pull request
    let milestone: GitHubMilestone?

    /// The link back to this PR as user-facing
    let htmlUrl: String
}

struct GitHubRepo {
    /// Generic UUID.
    let id: Int

    /// The name of the repo, e.g. "danger-swift".
    let name: String

    /// The full name of the owner + repo, e.g. "Danger/danger-swift"
    let fullName: String

    /// The owner of the repo.
    let owner: GitHubUser

    /// A boolean stating whether the repo is publicly accessible.
    let isPrivate: Bool

    /// A textual description of the repo.
    let description: String?

    /// A boolean stating whether the repo is a fork.
    let isFork: Bool

    /// The root web URL for the repo, e.g. https://github.com/artsy/emission
    let htmlURL: String
}

/// Represents the payload for a PR's requested reviewers value.
struct GitHubRequestedReviewers {
    /// The list of users of whom a review has been requested.
    let users: [GitHubUser]

    /// The list of teams of whom a review has been requested.
    let teams: [GitHubTeam]
}

struct GitHubReview {
    enum ReviewState: String, Decodable {
        case approved

        case requestedChanges

        case comment

        case pending

        case dismissed
    }

    /// The user who has completed the review or has been requested to review.
    let user: GitHubUser

    /// The id for the review (if a review was made).
    let id: Int?

    /// The body of the review (if a review was made).
    let body: String?

    /// The commit ID the review was made on (if a review was made).
    let commitId: String?

    /// The state of the review (if a review was made).
    let state: GitHubReview.ReviewState?
}

/// A GitHub team.
struct GitHubTeam {
    /// The UUID for the team.
    let id: Int

    /// The team name
    let name: String
}

/// A GitHub user account.
struct GitHubUser {
    enum UserType: String, Decodable {
        case user

        case organization
    }

    /// The UUID for the user organization.
    let id: Int

    /// The handle for the user or organization.
    let login: String

    /// The type of user: user or organization.
    let userType: GitHubUser.UserType
}

/// Meta information for showing in the text info
struct Meta: Encodable {}

enum SpawnError: Error {
    case commandFailed(exitCode: Int32, stdout: String, stderr: String, task: Process)
}

/// The SwiftLint plugin has been embedded inside Danger, making
/// it usable out of the box.
struct SwiftLint {
    /// This is the main entry point for linting Swift in PRs.
    ///
    /// When the swiftlintPath is not specified,
    /// it uses by default swift run swiftlint if the Package.swift contains swiftlint as dependency,
    /// otherwise calls directly the swiftlint command
    static func lint(inline: Bool = default, directory: String? = default, configFile: String? = default, strict: Bool = default, lintAllFiles: Bool = default, swiftlintPath: String? = default) -> [SwiftLintViolation]
}

struct SwiftLintViolation: Decodable {
    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    init(from decoder: Decoder) throws

    func toMarkdown() -> String
}

/// The result of a warn, message, or fail.
struct Violation: Encodable {}

/// Adds an inline fail message to the Danger report
func fail(message: String, file: String, line: Int)

/// Adds a warning message to the Danger report
///
/// - Parameter message: A markdown-ish
func fail(_ message: String)

/// Fails on the Danger report
var fails: [Violation] { get }

/// Adds a warning message to the Danger report
///
/// - Parameter message: A markdown-ish
func markdown(_ message: String)

/// Adds an inline message to the Danger report
func markdown(message: String, file: String, line: Int)

/// Markdowns on the Danger report
var markdowns: [Violation] { get }

/// Adds an inline message to the Danger report
func message(message: String, file: String, line: Int)

/// Adds a warning message to the Danger report
///
/// - Parameter message: A markdown-ish
func message(_ message: String)

/// Messages on the Danger report
var messages: [Violation] { get }

/// Adds an inline suggestion to the Danger report (sends a normal message if suggestions are not supported)
func suggestion(code: String, file: String, line: Int)

/// Adds a warning message to the Danger report
///
/// - Parameter message: A markdown-ish
func warn(_ message: String)

/// Adds an inline warning message to the Danger report
func warn(message: String, file: String, line: Int)

/// Warnings on the Danger report
var warnings: [Violation] { get }

extension DateFormatter {
    static var defaultDateFormatter: DateFormatter { get }
}

extension String {
    var fileType: FileType? { get }

    var name: String { get }
}